// Copyright 2025 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by sidekick. DO NOT EDIT.

#![allow(rustdoc::redundant_explicit_links)]
#![allow(rustdoc::broken_intra_doc_links)]
#![no_implicit_prelude]
extern crate async_trait;
extern crate bytes;
extern crate gax;
extern crate gaxi;
extern crate lazy_static;
extern crate reqwest;
extern crate rpc;
extern crate serde;
extern crate serde_json;
extern crate serde_with;
extern crate std;
extern crate tracing;
extern crate wkt;

mod debug;
mod deserialize;
mod serialize;

/// Transcoding job resource.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Job {
    /// The resource name of the job.
    /// Format: `projects/{project_number}/locations/{location}/jobs/{job}`
    pub name: std::string::String,

    /// Input only. Specify the `input_uri` to populate empty `uri` fields in each
    /// element of `Job.config.inputs` or `JobTemplate.config.inputs` when using
    /// template. URI of the media. Input files must be at least 5 seconds in
    /// duration and stored in Cloud Storage (for example,
    /// `gs://bucket/inputs/file.mp4`). See [Supported input and output
    /// formats](https://cloud.google.com/transcoder/docs/concepts/supported-input-and-output-formats).
    pub input_uri: std::string::String,

    /// Input only. Specify the `output_uri` to populate an empty
    /// `Job.config.output.uri` or `JobTemplate.config.output.uri` when using
    /// template. URI for the output file(s). For example,
    /// `gs://my-bucket/outputs/`. See [Supported input and output
    /// formats](https://cloud.google.com/transcoder/docs/concepts/supported-input-and-output-formats).
    pub output_uri: std::string::String,

    /// Output only. The current state of the job.
    pub state: crate::model::job::ProcessingState,

    /// Output only. The time the job was created.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. The time the transcoding started.
    pub start_time: std::option::Option<wkt::Timestamp>,

    /// Output only. The time the transcoding finished.
    pub end_time: std::option::Option<wkt::Timestamp>,

    /// Job time to live value in days, which will be effective after job
    /// completion. Job should be deleted automatically after the given TTL. Enter
    /// a value between 1 and 90. The default is 30.
    pub ttl_after_completion_days: i32,

    /// The labels associated with this job. You can use these to organize and
    /// group your jobs.
    pub labels: std::collections::HashMap<std::string::String, std::string::String>,

    /// Output only. An error object that describes the reason for the failure.
    /// This property is always present when
    /// [ProcessingState][google.cloud.video.transcoder.v1.Job.ProcessingState] is
    /// `FAILED`.
    ///
    /// [google.cloud.video.transcoder.v1.Job.ProcessingState]: crate::model::job::ProcessingState
    pub error: std::option::Option<rpc::model::Status>,

    /// The processing mode of the job.
    /// The default is `PROCESSING_MODE_INTERACTIVE`.
    pub mode: crate::model::job::ProcessingMode,

    /// The processing priority of a batch job.
    /// This field can only be set for batch mode jobs. The default value is 0.
    /// This value cannot be negative. Higher values correspond to higher
    /// priorities for the job.
    pub batch_mode_priority: i32,

    /// Optional. The optimization strategy of the job. The default is
    /// `AUTODETECT`.
    pub optimization: crate::model::job::OptimizationStrategy,

    /// Optional. Insert silence and duplicate frames when timestamp gaps are
    /// detected in a given stream.
    pub fill_content_gaps: bool,

    /// Specify the config for the transcoding job. If you don't specify the
    /// `job_config`, the API selects `templateId`; this template ID is set to
    /// `preset/web-hd` by default. When you use a `template_id` to create a job,
    /// the `Job.config` is populated by the `JobTemplate.config`.\<br\>
    pub job_config: std::option::Option<crate::model::job::JobConfig>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Job {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::Job::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [input_uri][crate::model::Job::input_uri].
    pub fn set_input_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.input_uri = v.into();
        self
    }

    /// Sets the value of [output_uri][crate::model::Job::output_uri].
    pub fn set_output_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.output_uri = v.into();
        self
    }

    /// Sets the value of [state][crate::model::Job::state].
    pub fn set_state<T: std::convert::Into<crate::model::job::ProcessingState>>(
        mut self,
        v: T,
    ) -> Self {
        self.state = v.into();
        self
    }

    /// Sets the value of [create_time][crate::model::Job::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::Job::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [start_time][crate::model::Job::start_time].
    pub fn set_start_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.start_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [start_time][crate::model::Job::start_time].
    pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.start_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [end_time][crate::model::Job::end_time].
    pub fn set_end_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.end_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [end_time][crate::model::Job::end_time].
    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.end_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [ttl_after_completion_days][crate::model::Job::ttl_after_completion_days].
    pub fn set_ttl_after_completion_days<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.ttl_after_completion_days = v.into();
        self
    }

    /// Sets the value of [labels][crate::model::Job::labels].
    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [error][crate::model::Job::error].
    pub fn set_error<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<rpc::model::Status>,
    {
        self.error = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [error][crate::model::Job::error].
    pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<rpc::model::Status>,
    {
        self.error = v.map(|x| x.into());
        self
    }

    /// Sets the value of [mode][crate::model::Job::mode].
    pub fn set_mode<T: std::convert::Into<crate::model::job::ProcessingMode>>(
        mut self,
        v: T,
    ) -> Self {
        self.mode = v.into();
        self
    }

    /// Sets the value of [batch_mode_priority][crate::model::Job::batch_mode_priority].
    pub fn set_batch_mode_priority<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.batch_mode_priority = v.into();
        self
    }

    /// Sets the value of [optimization][crate::model::Job::optimization].
    pub fn set_optimization<T: std::convert::Into<crate::model::job::OptimizationStrategy>>(
        mut self,
        v: T,
    ) -> Self {
        self.optimization = v.into();
        self
    }

    /// Sets the value of [fill_content_gaps][crate::model::Job::fill_content_gaps].
    pub fn set_fill_content_gaps<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.fill_content_gaps = v.into();
        self
    }

    /// Sets the value of [job_config][crate::model::Job::job_config].
    ///
    /// Note that all the setters affecting `job_config` are mutually
    /// exclusive.
    pub fn set_job_config<
        T: std::convert::Into<std::option::Option<crate::model::job::JobConfig>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.job_config = v.into();
        self
    }

    /// The value of [job_config][crate::model::Job::job_config]
    /// if it holds a `TemplateId`, `None` if the field is not set or
    /// holds a different branch.
    pub fn template_id(&self) -> std::option::Option<&std::string::String> {
        #[allow(unreachable_patterns)]
        self.job_config.as_ref().and_then(|v| match v {
            crate::model::job::JobConfig::TemplateId(v) => std::option::Option::Some(v),
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [job_config][crate::model::Job::job_config]
    /// to hold a `TemplateId`.
    ///
    /// Note that all the setters affecting `job_config` are
    /// mutually exclusive.
    pub fn set_template_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.job_config =
            std::option::Option::Some(crate::model::job::JobConfig::TemplateId(v.into()));
        self
    }

    /// The value of [job_config][crate::model::Job::job_config]
    /// if it holds a `Config`, `None` if the field is not set or
    /// holds a different branch.
    pub fn config(&self) -> std::option::Option<&std::boxed::Box<crate::model::JobConfig>> {
        #[allow(unreachable_patterns)]
        self.job_config.as_ref().and_then(|v| match v {
            crate::model::job::JobConfig::Config(v) => std::option::Option::Some(v),
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [job_config][crate::model::Job::job_config]
    /// to hold a `Config`.
    ///
    /// Note that all the setters affecting `job_config` are
    /// mutually exclusive.
    pub fn set_config<T: std::convert::Into<std::boxed::Box<crate::model::JobConfig>>>(
        mut self,
        v: T,
    ) -> Self {
        self.job_config = std::option::Option::Some(crate::model::job::JobConfig::Config(v.into()));
        self
    }
}

impl wkt::message::Message for Job {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.transcoder.v1.Job"
    }
}

/// Defines additional types related to [Job].
pub mod job {
    #[allow(unused_imports)]
    use super::*;

    /// The current state of the job.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum ProcessingState {
        /// The processing state is not specified.
        Unspecified,
        /// The job is enqueued and will be picked up for processing soon.
        Pending,
        /// The job is being processed.
        Running,
        /// The job has been completed successfully.
        Succeeded,
        /// The job has failed. For additional information, see
        /// [Troubleshooting](https://cloud.google.com/transcoder/docs/troubleshooting).
        Failed,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [ProcessingState::value] or
        /// [ProcessingState::name].
        UnknownValue(processing_state::UnknownValue),
    }

    #[doc(hidden)]
    pub mod processing_state {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl ProcessingState {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Pending => std::option::Option::Some(1),
                Self::Running => std::option::Option::Some(2),
                Self::Succeeded => std::option::Option::Some(3),
                Self::Failed => std::option::Option::Some(4),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("PROCESSING_STATE_UNSPECIFIED"),
                Self::Pending => std::option::Option::Some("PENDING"),
                Self::Running => std::option::Option::Some("RUNNING"),
                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
                Self::Failed => std::option::Option::Some("FAILED"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for ProcessingState {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for ProcessingState {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for ProcessingState {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Pending,
                2 => Self::Running,
                3 => Self::Succeeded,
                4 => Self::Failed,
                _ => Self::UnknownValue(processing_state::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for ProcessingState {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "PROCESSING_STATE_UNSPECIFIED" => Self::Unspecified,
                "PENDING" => Self::Pending,
                "RUNNING" => Self::Running,
                "SUCCEEDED" => Self::Succeeded,
                "FAILED" => Self::Failed,
                _ => Self::UnknownValue(processing_state::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for ProcessingState {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Pending => serializer.serialize_i32(1),
                Self::Running => serializer.serialize_i32(2),
                Self::Succeeded => serializer.serialize_i32(3),
                Self::Failed => serializer.serialize_i32(4),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for ProcessingState {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProcessingState>::new(
                ".google.cloud.video.transcoder.v1.Job.ProcessingState",
            ))
        }
    }

    /// The processing mode of the job.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum ProcessingMode {
        /// The job processing mode is not specified.
        Unspecified,
        /// The job processing mode is interactive mode.
        /// Interactive job will either be ran or rejected if quota does not allow
        /// for it.
        Interactive,
        /// The job processing mode is batch mode.
        /// Batch mode allows queuing of jobs.
        Batch,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [ProcessingMode::value] or
        /// [ProcessingMode::name].
        UnknownValue(processing_mode::UnknownValue),
    }

    #[doc(hidden)]
    pub mod processing_mode {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl ProcessingMode {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Interactive => std::option::Option::Some(1),
                Self::Batch => std::option::Option::Some(2),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("PROCESSING_MODE_UNSPECIFIED"),
                Self::Interactive => std::option::Option::Some("PROCESSING_MODE_INTERACTIVE"),
                Self::Batch => std::option::Option::Some("PROCESSING_MODE_BATCH"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for ProcessingMode {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for ProcessingMode {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for ProcessingMode {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Interactive,
                2 => Self::Batch,
                _ => Self::UnknownValue(processing_mode::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for ProcessingMode {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "PROCESSING_MODE_UNSPECIFIED" => Self::Unspecified,
                "PROCESSING_MODE_INTERACTIVE" => Self::Interactive,
                "PROCESSING_MODE_BATCH" => Self::Batch,
                _ => Self::UnknownValue(processing_mode::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for ProcessingMode {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Interactive => serializer.serialize_i32(1),
                Self::Batch => serializer.serialize_i32(2),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for ProcessingMode {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProcessingMode>::new(
                ".google.cloud.video.transcoder.v1.Job.ProcessingMode",
            ))
        }
    }

    /// The optimization strategy of the job. The default is `AUTODETECT`.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum OptimizationStrategy {
        /// The optimization strategy is not specified.
        Unspecified,
        /// Prioritize job processing speed.
        Autodetect,
        /// Disable all optimizations.
        Disabled,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [OptimizationStrategy::value] or
        /// [OptimizationStrategy::name].
        UnknownValue(optimization_strategy::UnknownValue),
    }

    #[doc(hidden)]
    pub mod optimization_strategy {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl OptimizationStrategy {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Autodetect => std::option::Option::Some(1),
                Self::Disabled => std::option::Option::Some(2),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("OPTIMIZATION_STRATEGY_UNSPECIFIED"),
                Self::Autodetect => std::option::Option::Some("AUTODETECT"),
                Self::Disabled => std::option::Option::Some("DISABLED"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for OptimizationStrategy {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for OptimizationStrategy {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for OptimizationStrategy {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Autodetect,
                2 => Self::Disabled,
                _ => Self::UnknownValue(optimization_strategy::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for OptimizationStrategy {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "OPTIMIZATION_STRATEGY_UNSPECIFIED" => Self::Unspecified,
                "AUTODETECT" => Self::Autodetect,
                "DISABLED" => Self::Disabled,
                _ => Self::UnknownValue(optimization_strategy::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for OptimizationStrategy {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Autodetect => serializer.serialize_i32(1),
                Self::Disabled => serializer.serialize_i32(2),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for OptimizationStrategy {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<OptimizationStrategy>::new(
                ".google.cloud.video.transcoder.v1.Job.OptimizationStrategy",
            ))
        }
    }

    /// Specify the config for the transcoding job. If you don't specify the
    /// `job_config`, the API selects `templateId`; this template ID is set to
    /// `preset/web-hd` by default. When you use a `template_id` to create a job,
    /// the `Job.config` is populated by the `JobTemplate.config`.\<br\>
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum JobConfig {
        /// Input only. Specify the `template_id` to use for populating `Job.config`.
        /// The default is `preset/web-hd`, which is the only supported preset.
        ///
        /// User defined JobTemplate: `{job_template_id}`
        TemplateId(std::string::String),
        /// The configuration for this job.
        Config(std::boxed::Box<crate::model::JobConfig>),
    }
}

/// Transcoding job template resource.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct JobTemplate {
    /// The resource name of the job template.
    /// Format:
    /// `projects/{project_number}/locations/{location}/jobTemplates/{job_template}`
    pub name: std::string::String,

    /// The configuration for this template.
    pub config: std::option::Option<crate::model::JobConfig>,

    /// The labels associated with this job template. You can use these to organize
    /// and group your job templates.
    pub labels: std::collections::HashMap<std::string::String, std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl JobTemplate {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::JobTemplate::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [config][crate::model::JobTemplate::config].
    pub fn set_config<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::JobConfig>,
    {
        self.config = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [config][crate::model::JobTemplate::config].
    pub fn set_or_clear_config<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::JobConfig>,
    {
        self.config = v.map(|x| x.into());
        self
    }

    /// Sets the value of [labels][crate::model::JobTemplate::labels].
    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }
}

impl wkt::message::Message for JobTemplate {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.transcoder.v1.JobTemplate"
    }
}

/// Job configuration
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct JobConfig {
    /// List of input assets stored in Cloud Storage.
    pub inputs: std::vec::Vec<crate::model::Input>,

    /// List of edit atoms. Defines the ultimate timeline of the resulting
    /// file or manifest.
    pub edit_list: std::vec::Vec<crate::model::EditAtom>,

    /// List of elementary streams.
    pub elementary_streams: std::vec::Vec<crate::model::ElementaryStream>,

    /// List of multiplexing settings for output streams.
    pub mux_streams: std::vec::Vec<crate::model::MuxStream>,

    /// List of output manifests.
    pub manifests: std::vec::Vec<crate::model::Manifest>,

    /// Output configuration.
    pub output: std::option::Option<crate::model::Output>,

    /// List of ad breaks. Specifies where to insert ad break tags in the output
    /// manifests.
    pub ad_breaks: std::vec::Vec<crate::model::AdBreak>,

    /// Destination on Pub/Sub.
    pub pubsub_destination: std::option::Option<crate::model::PubsubDestination>,

    /// List of output sprite sheets.
    /// Spritesheets require at least one VideoStream in the Jobconfig.
    pub sprite_sheets: std::vec::Vec<crate::model::SpriteSheet>,

    /// List of overlays on the output video, in descending Z-order.
    pub overlays: std::vec::Vec<crate::model::Overlay>,

    /// List of encryption configurations for the content.
    /// Each configuration has an ID. Specify this ID in the
    /// [MuxStream.encryption_id][google.cloud.video.transcoder.v1.MuxStream.encryption_id]
    /// field to indicate the configuration to use for that `MuxStream` output.
    ///
    /// [google.cloud.video.transcoder.v1.MuxStream.encryption_id]: crate::model::MuxStream::encryption_id
    pub encryptions: std::vec::Vec<crate::model::Encryption>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl JobConfig {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [inputs][crate::model::JobConfig::inputs].
    pub fn set_inputs<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::Input>,
    {
        use std::iter::Iterator;
        self.inputs = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [edit_list][crate::model::JobConfig::edit_list].
    pub fn set_edit_list<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::EditAtom>,
    {
        use std::iter::Iterator;
        self.edit_list = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [elementary_streams][crate::model::JobConfig::elementary_streams].
    pub fn set_elementary_streams<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::ElementaryStream>,
    {
        use std::iter::Iterator;
        self.elementary_streams = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [mux_streams][crate::model::JobConfig::mux_streams].
    pub fn set_mux_streams<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::MuxStream>,
    {
        use std::iter::Iterator;
        self.mux_streams = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [manifests][crate::model::JobConfig::manifests].
    pub fn set_manifests<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::Manifest>,
    {
        use std::iter::Iterator;
        self.manifests = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [output][crate::model::JobConfig::output].
    pub fn set_output<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Output>,
    {
        self.output = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [output][crate::model::JobConfig::output].
    pub fn set_or_clear_output<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Output>,
    {
        self.output = v.map(|x| x.into());
        self
    }

    /// Sets the value of [ad_breaks][crate::model::JobConfig::ad_breaks].
    pub fn set_ad_breaks<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::AdBreak>,
    {
        use std::iter::Iterator;
        self.ad_breaks = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [pubsub_destination][crate::model::JobConfig::pubsub_destination].
    pub fn set_pubsub_destination<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::PubsubDestination>,
    {
        self.pubsub_destination = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [pubsub_destination][crate::model::JobConfig::pubsub_destination].
    pub fn set_or_clear_pubsub_destination<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::PubsubDestination>,
    {
        self.pubsub_destination = v.map(|x| x.into());
        self
    }

    /// Sets the value of [sprite_sheets][crate::model::JobConfig::sprite_sheets].
    pub fn set_sprite_sheets<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::SpriteSheet>,
    {
        use std::iter::Iterator;
        self.sprite_sheets = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [overlays][crate::model::JobConfig::overlays].
    pub fn set_overlays<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::Overlay>,
    {
        use std::iter::Iterator;
        self.overlays = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [encryptions][crate::model::JobConfig::encryptions].
    pub fn set_encryptions<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::Encryption>,
    {
        use std::iter::Iterator;
        self.encryptions = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for JobConfig {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.transcoder.v1.JobConfig"
    }
}

/// Input asset.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Input {
    /// A unique key for this input. Must be specified when using advanced
    /// mapping and edit lists.
    pub key: std::string::String,

    /// URI of the media. Input files must be at least 5 seconds in duration and
    /// stored in Cloud Storage (for example, `gs://bucket/inputs/file.mp4`).
    /// If empty, the value is populated from
    /// [Job.input_uri][google.cloud.video.transcoder.v1.Job.input_uri]. See
    /// [Supported input and output
    /// formats](https://cloud.google.com/transcoder/docs/concepts/supported-input-and-output-formats).
    ///
    /// [google.cloud.video.transcoder.v1.Job.input_uri]: crate::model::Job::input_uri
    pub uri: std::string::String,

    /// Preprocessing configurations.
    pub preprocessing_config: std::option::Option<crate::model::PreprocessingConfig>,

    /// Optional. Input Attributes.
    pub attributes: std::option::Option<crate::model::InputAttributes>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Input {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [key][crate::model::Input::key].
    pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.key = v.into();
        self
    }

    /// Sets the value of [uri][crate::model::Input::uri].
    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.uri = v.into();
        self
    }

    /// Sets the value of [preprocessing_config][crate::model::Input::preprocessing_config].
    pub fn set_preprocessing_config<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::PreprocessingConfig>,
    {
        self.preprocessing_config = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [preprocessing_config][crate::model::Input::preprocessing_config].
    pub fn set_or_clear_preprocessing_config<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::PreprocessingConfig>,
    {
        self.preprocessing_config = v.map(|x| x.into());
        self
    }

    /// Sets the value of [attributes][crate::model::Input::attributes].
    pub fn set_attributes<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::InputAttributes>,
    {
        self.attributes = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [attributes][crate::model::Input::attributes].
    pub fn set_or_clear_attributes<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::InputAttributes>,
    {
        self.attributes = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for Input {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.transcoder.v1.Input"
    }
}

/// Location of output file(s) in a Cloud Storage bucket.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Output {
    /// URI for the output file(s). For example, `gs://my-bucket/outputs/`. Must be
    /// a directory and not a top-level bucket. If empty, the value is populated
    /// from [Job.output_uri][google.cloud.video.transcoder.v1.Job.output_uri]. See
    /// [Supported input and output
    /// formats](https://cloud.google.com/transcoder/docs/concepts/supported-input-and-output-formats).
    ///
    /// [google.cloud.video.transcoder.v1.Job.output_uri]: crate::model::Job::output_uri
    pub uri: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Output {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [uri][crate::model::Output::uri].
    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.uri = v.into();
        self
    }
}

impl wkt::message::Message for Output {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.transcoder.v1.Output"
    }
}

/// Edit atom.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct EditAtom {
    /// A unique key for this atom. Must be specified when using advanced
    /// mapping.
    pub key: std::string::String,

    /// List of [Input.key][google.cloud.video.transcoder.v1.Input.key] values
    /// identifying files that should be used in this atom. The listed `inputs`
    /// must have the same timeline.
    ///
    /// [google.cloud.video.transcoder.v1.Input.key]: crate::model::Input::key
    pub inputs: std::vec::Vec<std::string::String>,

    /// End time in seconds for the atom, relative to the input file timeline.
    /// When `end_time_offset` is not specified, the `inputs` are used until
    /// the end of the atom.
    pub end_time_offset: std::option::Option<wkt::Duration>,

    /// Start time in seconds for the atom, relative to the input file timeline.
    /// The default is `0s`.
    pub start_time_offset: std::option::Option<wkt::Duration>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl EditAtom {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [key][crate::model::EditAtom::key].
    pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.key = v.into();
        self
    }

    /// Sets the value of [inputs][crate::model::EditAtom::inputs].
    pub fn set_inputs<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.inputs = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [end_time_offset][crate::model::EditAtom::end_time_offset].
    pub fn set_end_time_offset<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Duration>,
    {
        self.end_time_offset = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [end_time_offset][crate::model::EditAtom::end_time_offset].
    pub fn set_or_clear_end_time_offset<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Duration>,
    {
        self.end_time_offset = v.map(|x| x.into());
        self
    }

    /// Sets the value of [start_time_offset][crate::model::EditAtom::start_time_offset].
    pub fn set_start_time_offset<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Duration>,
    {
        self.start_time_offset = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [start_time_offset][crate::model::EditAtom::start_time_offset].
    pub fn set_or_clear_start_time_offset<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Duration>,
    {
        self.start_time_offset = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for EditAtom {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.transcoder.v1.EditAtom"
    }
}

/// Ad break.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AdBreak {
    /// Start time in seconds for the ad break, relative to the output file
    /// timeline. The default is `0s`.
    pub start_time_offset: std::option::Option<wkt::Duration>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl AdBreak {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [start_time_offset][crate::model::AdBreak::start_time_offset].
    pub fn set_start_time_offset<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Duration>,
    {
        self.start_time_offset = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [start_time_offset][crate::model::AdBreak::start_time_offset].
    pub fn set_or_clear_start_time_offset<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Duration>,
    {
        self.start_time_offset = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for AdBreak {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.transcoder.v1.AdBreak"
    }
}

/// Encoding of an input file such as an audio, video, or text track.
/// Elementary streams must be packaged before
/// mapping and sharing between different output formats.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ElementaryStream {
    /// A unique key for this elementary stream.
    pub key: std::string::String,

    /// Encoding of an audio, video, or text track.
    pub elementary_stream: std::option::Option<crate::model::elementary_stream::ElementaryStream>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ElementaryStream {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [key][crate::model::ElementaryStream::key].
    pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.key = v.into();
        self
    }

    /// Sets the value of [elementary_stream][crate::model::ElementaryStream::elementary_stream].
    ///
    /// Note that all the setters affecting `elementary_stream` are mutually
    /// exclusive.
    pub fn set_elementary_stream<
        T: std::convert::Into<std::option::Option<crate::model::elementary_stream::ElementaryStream>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.elementary_stream = v.into();
        self
    }

    /// The value of [elementary_stream][crate::model::ElementaryStream::elementary_stream]
    /// if it holds a `VideoStream`, `None` if the field is not set or
    /// holds a different branch.
    pub fn video_stream(&self) -> std::option::Option<&std::boxed::Box<crate::model::VideoStream>> {
        #[allow(unreachable_patterns)]
        self.elementary_stream.as_ref().and_then(|v| match v {
            crate::model::elementary_stream::ElementaryStream::VideoStream(v) => {
                std::option::Option::Some(v)
            }
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [elementary_stream][crate::model::ElementaryStream::elementary_stream]
    /// to hold a `VideoStream`.
    ///
    /// Note that all the setters affecting `elementary_stream` are
    /// mutually exclusive.
    pub fn set_video_stream<T: std::convert::Into<std::boxed::Box<crate::model::VideoStream>>>(
        mut self,
        v: T,
    ) -> Self {
        self.elementary_stream = std::option::Option::Some(
            crate::model::elementary_stream::ElementaryStream::VideoStream(v.into()),
        );
        self
    }

    /// The value of [elementary_stream][crate::model::ElementaryStream::elementary_stream]
    /// if it holds a `AudioStream`, `None` if the field is not set or
    /// holds a different branch.
    pub fn audio_stream(&self) -> std::option::Option<&std::boxed::Box<crate::model::AudioStream>> {
        #[allow(unreachable_patterns)]
        self.elementary_stream.as_ref().and_then(|v| match v {
            crate::model::elementary_stream::ElementaryStream::AudioStream(v) => {
                std::option::Option::Some(v)
            }
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [elementary_stream][crate::model::ElementaryStream::elementary_stream]
    /// to hold a `AudioStream`.
    ///
    /// Note that all the setters affecting `elementary_stream` are
    /// mutually exclusive.
    pub fn set_audio_stream<T: std::convert::Into<std::boxed::Box<crate::model::AudioStream>>>(
        mut self,
        v: T,
    ) -> Self {
        self.elementary_stream = std::option::Option::Some(
            crate::model::elementary_stream::ElementaryStream::AudioStream(v.into()),
        );
        self
    }

    /// The value of [elementary_stream][crate::model::ElementaryStream::elementary_stream]
    /// if it holds a `TextStream`, `None` if the field is not set or
    /// holds a different branch.
    pub fn text_stream(&self) -> std::option::Option<&std::boxed::Box<crate::model::TextStream>> {
        #[allow(unreachable_patterns)]
        self.elementary_stream.as_ref().and_then(|v| match v {
            crate::model::elementary_stream::ElementaryStream::TextStream(v) => {
                std::option::Option::Some(v)
            }
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [elementary_stream][crate::model::ElementaryStream::elementary_stream]
    /// to hold a `TextStream`.
    ///
    /// Note that all the setters affecting `elementary_stream` are
    /// mutually exclusive.
    pub fn set_text_stream<T: std::convert::Into<std::boxed::Box<crate::model::TextStream>>>(
        mut self,
        v: T,
    ) -> Self {
        self.elementary_stream = std::option::Option::Some(
            crate::model::elementary_stream::ElementaryStream::TextStream(v.into()),
        );
        self
    }
}

impl wkt::message::Message for ElementaryStream {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.transcoder.v1.ElementaryStream"
    }
}

/// Defines additional types related to [ElementaryStream].
pub mod elementary_stream {
    #[allow(unused_imports)]
    use super::*;

    /// Encoding of an audio, video, or text track.
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum ElementaryStream {
        /// Encoding of a video stream.
        VideoStream(std::boxed::Box<crate::model::VideoStream>),
        /// Encoding of an audio stream.
        AudioStream(std::boxed::Box<crate::model::AudioStream>),
        /// Encoding of a text stream. For example, closed captions or subtitles.
        TextStream(std::boxed::Box<crate::model::TextStream>),
    }
}

/// Multiplexing settings for output stream.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MuxStream {
    /// A unique key for this multiplexed stream.
    pub key: std::string::String,

    /// The name of the generated file. The default is
    /// [MuxStream.key][google.cloud.video.transcoder.v1.MuxStream.key] with the
    /// extension suffix corresponding to the
    /// [MuxStream.container][google.cloud.video.transcoder.v1.MuxStream.container].
    ///
    /// Individual segments also have an incremental 10-digit zero-padded suffix
    /// starting from 0 before the extension, such as `mux_stream0000000123.ts`.
    ///
    /// [google.cloud.video.transcoder.v1.MuxStream.container]: crate::model::MuxStream::container
    /// [google.cloud.video.transcoder.v1.MuxStream.key]: crate::model::MuxStream::key
    pub file_name: std::string::String,

    /// The container format. The default is `mp4`
    ///
    /// Supported streaming formats:
    ///
    /// - `ts`
    /// - `fmp4`- the corresponding file extension is `.m4s`
    ///
    /// Supported standalone file formats:
    ///
    /// - `mp4`
    /// - `mp3`
    /// - `ogg`
    /// - `vtt`
    ///
    /// See also:
    /// [Supported input and output
    /// formats](https://cloud.google.com/transcoder/docs/concepts/supported-input-and-output-formats)
    pub container: std::string::String,

    /// List of
    /// [ElementaryStream.key][google.cloud.video.transcoder.v1.ElementaryStream.key]
    /// values multiplexed in this stream.
    ///
    /// [google.cloud.video.transcoder.v1.ElementaryStream.key]: crate::model::ElementaryStream::key
    pub elementary_streams: std::vec::Vec<std::string::String>,

    /// Segment settings for `ts`, `fmp4` and `vtt`.
    pub segment_settings: std::option::Option<crate::model::SegmentSettings>,

    /// Identifier of the encryption configuration to use. If omitted, output will
    /// be unencrypted.
    pub encryption_id: std::string::String,

    /// Specifies the container configuration.
    pub container_config: std::option::Option<crate::model::mux_stream::ContainerConfig>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl MuxStream {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [key][crate::model::MuxStream::key].
    pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.key = v.into();
        self
    }

    /// Sets the value of [file_name][crate::model::MuxStream::file_name].
    pub fn set_file_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.file_name = v.into();
        self
    }

    /// Sets the value of [container][crate::model::MuxStream::container].
    pub fn set_container<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.container = v.into();
        self
    }

    /// Sets the value of [elementary_streams][crate::model::MuxStream::elementary_streams].
    pub fn set_elementary_streams<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.elementary_streams = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [segment_settings][crate::model::MuxStream::segment_settings].
    pub fn set_segment_settings<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::SegmentSettings>,
    {
        self.segment_settings = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [segment_settings][crate::model::MuxStream::segment_settings].
    pub fn set_or_clear_segment_settings<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::SegmentSettings>,
    {
        self.segment_settings = v.map(|x| x.into());
        self
    }

    /// Sets the value of [encryption_id][crate::model::MuxStream::encryption_id].
    pub fn set_encryption_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.encryption_id = v.into();
        self
    }

    /// Sets the value of [container_config][crate::model::MuxStream::container_config].
    ///
    /// Note that all the setters affecting `container_config` are mutually
    /// exclusive.
    pub fn set_container_config<
        T: std::convert::Into<std::option::Option<crate::model::mux_stream::ContainerConfig>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.container_config = v.into();
        self
    }

    /// The value of [container_config][crate::model::MuxStream::container_config]
    /// if it holds a `Fmp4`, `None` if the field is not set or
    /// holds a different branch.
    pub fn fmp4(
        &self,
    ) -> std::option::Option<&std::boxed::Box<crate::model::mux_stream::Fmp4Config>> {
        #[allow(unreachable_patterns)]
        self.container_config.as_ref().and_then(|v| match v {
            crate::model::mux_stream::ContainerConfig::Fmp4(v) => std::option::Option::Some(v),
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [container_config][crate::model::MuxStream::container_config]
    /// to hold a `Fmp4`.
    ///
    /// Note that all the setters affecting `container_config` are
    /// mutually exclusive.
    pub fn set_fmp4<
        T: std::convert::Into<std::boxed::Box<crate::model::mux_stream::Fmp4Config>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.container_config =
            std::option::Option::Some(crate::model::mux_stream::ContainerConfig::Fmp4(v.into()));
        self
    }
}

impl wkt::message::Message for MuxStream {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.transcoder.v1.MuxStream"
    }
}

/// Defines additional types related to [MuxStream].
pub mod mux_stream {
    #[allow(unused_imports)]
    use super::*;

    /// `fmp4` container configuration.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct Fmp4Config {
        /// Optional. Specify the codec tag string that will be used in the media
        /// bitstream. When not specified, the codec appropriate value is used.
        ///
        /// Supported H265 codec tags:
        ///
        /// - `hvc1` (default)
        /// - `hev1`
        pub codec_tag: std::string::String,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl Fmp4Config {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [codec_tag][crate::model::mux_stream::Fmp4Config::codec_tag].
        pub fn set_codec_tag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.codec_tag = v.into();
            self
        }
    }

    impl wkt::message::Message for Fmp4Config {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.video.transcoder.v1.MuxStream.Fmp4Config"
        }
    }

    /// Specifies the container configuration.
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum ContainerConfig {
        /// Optional. `fmp4` container configuration.
        Fmp4(std::boxed::Box<crate::model::mux_stream::Fmp4Config>),
    }
}

/// Manifest configuration.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Manifest {
    /// The name of the generated file. The default is `manifest` with the
    /// extension suffix corresponding to the
    /// [Manifest.type][google.cloud.video.transcoder.v1.Manifest.type].
    ///
    /// [google.cloud.video.transcoder.v1.Manifest.type]: crate::model::Manifest::type
    pub file_name: std::string::String,

    /// Required. Type of the manifest.
    pub r#type: crate::model::manifest::ManifestType,

    /// Required. List of user supplied
    /// [MuxStream.key][google.cloud.video.transcoder.v1.MuxStream.key] values that
    /// should appear in this manifest.
    ///
    /// When [Manifest.type][google.cloud.video.transcoder.v1.Manifest.type] is
    /// `HLS`, a media manifest with name
    /// [MuxStream.key][google.cloud.video.transcoder.v1.MuxStream.key] and `.m3u8`
    /// extension is generated for each element in this list.
    ///
    /// [google.cloud.video.transcoder.v1.Manifest.type]: crate::model::Manifest::type
    /// [google.cloud.video.transcoder.v1.MuxStream.key]: crate::model::MuxStream::key
    pub mux_streams: std::vec::Vec<std::string::String>,

    /// Specifies the manifest configuration.
    pub manifest_config: std::option::Option<crate::model::manifest::ManifestConfig>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Manifest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [file_name][crate::model::Manifest::file_name].
    pub fn set_file_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.file_name = v.into();
        self
    }

    /// Sets the value of [r#type][crate::model::Manifest::type].
    pub fn set_type<T: std::convert::Into<crate::model::manifest::ManifestType>>(
        mut self,
        v: T,
    ) -> Self {
        self.r#type = v.into();
        self
    }

    /// Sets the value of [mux_streams][crate::model::Manifest::mux_streams].
    pub fn set_mux_streams<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.mux_streams = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [manifest_config][crate::model::Manifest::manifest_config].
    ///
    /// Note that all the setters affecting `manifest_config` are mutually
    /// exclusive.
    pub fn set_manifest_config<
        T: std::convert::Into<std::option::Option<crate::model::manifest::ManifestConfig>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.manifest_config = v.into();
        self
    }

    /// The value of [manifest_config][crate::model::Manifest::manifest_config]
    /// if it holds a `Dash`, `None` if the field is not set or
    /// holds a different branch.
    pub fn dash(
        &self,
    ) -> std::option::Option<&std::boxed::Box<crate::model::manifest::DashConfig>> {
        #[allow(unreachable_patterns)]
        self.manifest_config.as_ref().and_then(|v| match v {
            crate::model::manifest::ManifestConfig::Dash(v) => std::option::Option::Some(v),
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [manifest_config][crate::model::Manifest::manifest_config]
    /// to hold a `Dash`.
    ///
    /// Note that all the setters affecting `manifest_config` are
    /// mutually exclusive.
    pub fn set_dash<T: std::convert::Into<std::boxed::Box<crate::model::manifest::DashConfig>>>(
        mut self,
        v: T,
    ) -> Self {
        self.manifest_config =
            std::option::Option::Some(crate::model::manifest::ManifestConfig::Dash(v.into()));
        self
    }
}

impl wkt::message::Message for Manifest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.transcoder.v1.Manifest"
    }
}

/// Defines additional types related to [Manifest].
pub mod manifest {
    #[allow(unused_imports)]
    use super::*;

    /// `DASH` manifest configuration.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct DashConfig {
        /// The segment reference scheme for a `DASH` manifest. The default is
        /// `SEGMENT_LIST`.
        pub segment_reference_scheme: crate::model::manifest::dash_config::SegmentReferenceScheme,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl DashConfig {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [segment_reference_scheme][crate::model::manifest::DashConfig::segment_reference_scheme].
        pub fn set_segment_reference_scheme<
            T: std::convert::Into<crate::model::manifest::dash_config::SegmentReferenceScheme>,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.segment_reference_scheme = v.into();
            self
        }
    }

    impl wkt::message::Message for DashConfig {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.video.transcoder.v1.Manifest.DashConfig"
        }
    }

    /// Defines additional types related to [DashConfig].
    pub mod dash_config {
        #[allow(unused_imports)]
        use super::*;

        /// The segment reference scheme for a `DASH` manifest.
        ///
        /// # Working with unknown values
        ///
        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
        /// additional enum variants at any time. Adding new variants is not considered
        /// a breaking change. Applications should write their code in anticipation of:
        ///
        /// - New values appearing in future releases of the client library, **and**
        /// - New values received dynamically, without application changes.
        ///
        /// Please consult the [Working with enums] section in the user guide for some
        /// guidelines.
        ///
        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
        #[derive(Clone, Debug, PartialEq)]
        #[non_exhaustive]
        pub enum SegmentReferenceScheme {
            /// The segment reference scheme is not specified.
            Unspecified,
            /// Explicitly lists the URLs of media files for each segment. For example,
            /// if
            /// [SegmentSettings.individual_segments][google.cloud.video.transcoder.v1.SegmentSettings.individual_segments]
            /// is `true`, then the manifest contains fields similar to the following:
            ///
            /// ```norust
            /// <Initialization sourceURL="my-hd-stream-init.m4s"/>
            ///   <SegmentList presentationTimeOffset="0" duration="1000"
            ///   timescale="10000">
            ///     <SegmentURL media="hd-stream0000000000.m4s"/>
            ///     <SegmentURL media="hd-stream0000000001.m4s"/>
            ///     ...
            /// ```
            ///
            /// [google.cloud.video.transcoder.v1.SegmentSettings.individual_segments]: crate::model::SegmentSettings::individual_segments
            SegmentList,
            /// [SegmentSettings.individual_segments][google.cloud.video.transcoder.v1.SegmentSettings.individual_segments]
            /// must be set to `true` to use this segment reference scheme. Uses the
            /// DASH specification
            /// `<SegmentTemplate>` tag to determine the URLs of media files for each
            /// segment. For example:
            ///
            /// ```norust
            /// <SegmentTemplate presentationTimeOffset="0" timescale="10000"
            ///       initialization="my-hd-stream-init.m4s"
            ///       media="hd-stream$Number%010d$.m4s" startNumber="0">
            ///   ...
            /// ```
            ///
            /// [google.cloud.video.transcoder.v1.SegmentSettings.individual_segments]: crate::model::SegmentSettings::individual_segments
            SegmentTemplateNumber,
            /// If set, the enum was initialized with an unknown value.
            ///
            /// Applications can examine the value using [SegmentReferenceScheme::value] or
            /// [SegmentReferenceScheme::name].
            UnknownValue(segment_reference_scheme::UnknownValue),
        }

        #[doc(hidden)]
        pub mod segment_reference_scheme {
            #[allow(unused_imports)]
            use super::*;
            #[derive(Clone, Debug, PartialEq)]
            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
        }

        impl SegmentReferenceScheme {
            /// Gets the enum value.
            ///
            /// Returns `None` if the enum contains an unknown value deserialized from
            /// the string representation of enums.
            pub fn value(&self) -> std::option::Option<i32> {
                match self {
                    Self::Unspecified => std::option::Option::Some(0),
                    Self::SegmentList => std::option::Option::Some(1),
                    Self::SegmentTemplateNumber => std::option::Option::Some(2),
                    Self::UnknownValue(u) => u.0.value(),
                }
            }

            /// Gets the enum value as a string.
            ///
            /// Returns `None` if the enum contains an unknown value deserialized from
            /// the integer representation of enums.
            pub fn name(&self) -> std::option::Option<&str> {
                match self {
                    Self::Unspecified => {
                        std::option::Option::Some("SEGMENT_REFERENCE_SCHEME_UNSPECIFIED")
                    }
                    Self::SegmentList => std::option::Option::Some("SEGMENT_LIST"),
                    Self::SegmentTemplateNumber => {
                        std::option::Option::Some("SEGMENT_TEMPLATE_NUMBER")
                    }
                    Self::UnknownValue(u) => u.0.name(),
                }
            }
        }

        impl std::default::Default for SegmentReferenceScheme {
            fn default() -> Self {
                use std::convert::From;
                Self::from(0)
            }
        }

        impl std::fmt::Display for SegmentReferenceScheme {
            fn fmt(
                &self,
                f: &mut std::fmt::Formatter<'_>,
            ) -> std::result::Result<(), std::fmt::Error> {
                wkt::internal::display_enum(f, self.name(), self.value())
            }
        }

        impl std::convert::From<i32> for SegmentReferenceScheme {
            fn from(value: i32) -> Self {
                match value {
                    0 => Self::Unspecified,
                    1 => Self::SegmentList,
                    2 => Self::SegmentTemplateNumber,
                    _ => Self::UnknownValue(segment_reference_scheme::UnknownValue(
                        wkt::internal::UnknownEnumValue::Integer(value),
                    )),
                }
            }
        }

        impl std::convert::From<&str> for SegmentReferenceScheme {
            fn from(value: &str) -> Self {
                use std::string::ToString;
                match value {
                    "SEGMENT_REFERENCE_SCHEME_UNSPECIFIED" => Self::Unspecified,
                    "SEGMENT_LIST" => Self::SegmentList,
                    "SEGMENT_TEMPLATE_NUMBER" => Self::SegmentTemplateNumber,
                    _ => Self::UnknownValue(segment_reference_scheme::UnknownValue(
                        wkt::internal::UnknownEnumValue::String(value.to_string()),
                    )),
                }
            }
        }

        impl serde::ser::Serialize for SegmentReferenceScheme {
            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
            where
                S: serde::Serializer,
            {
                match self {
                    Self::Unspecified => serializer.serialize_i32(0),
                    Self::SegmentList => serializer.serialize_i32(1),
                    Self::SegmentTemplateNumber => serializer.serialize_i32(2),
                    Self::UnknownValue(u) => u.0.serialize(serializer),
                }
            }
        }

        impl<'de> serde::de::Deserialize<'de> for SegmentReferenceScheme {
            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
            where
                D: serde::Deserializer<'de>,
            {
                deserializer.deserialize_any(wkt::internal::EnumVisitor::<SegmentReferenceScheme>::new(
                    ".google.cloud.video.transcoder.v1.Manifest.DashConfig.SegmentReferenceScheme"))
            }
        }
    }

    /// The manifest type, which corresponds to the adaptive streaming format used.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum ManifestType {
        /// The manifest type is not specified.
        Unspecified,
        /// Create an HLS manifest. The corresponding file extension is `.m3u8`.
        Hls,
        /// Create an MPEG-DASH manifest. The corresponding file extension is `.mpd`.
        Dash,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [ManifestType::value] or
        /// [ManifestType::name].
        UnknownValue(manifest_type::UnknownValue),
    }

    #[doc(hidden)]
    pub mod manifest_type {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl ManifestType {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Hls => std::option::Option::Some(1),
                Self::Dash => std::option::Option::Some(2),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("MANIFEST_TYPE_UNSPECIFIED"),
                Self::Hls => std::option::Option::Some("HLS"),
                Self::Dash => std::option::Option::Some("DASH"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for ManifestType {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for ManifestType {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for ManifestType {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Hls,
                2 => Self::Dash,
                _ => Self::UnknownValue(manifest_type::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for ManifestType {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "MANIFEST_TYPE_UNSPECIFIED" => Self::Unspecified,
                "HLS" => Self::Hls,
                "DASH" => Self::Dash,
                _ => Self::UnknownValue(manifest_type::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for ManifestType {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Hls => serializer.serialize_i32(1),
                Self::Dash => serializer.serialize_i32(2),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for ManifestType {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ManifestType>::new(
                ".google.cloud.video.transcoder.v1.Manifest.ManifestType",
            ))
        }
    }

    /// Specifies the manifest configuration.
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum ManifestConfig {
        /// `DASH` manifest configuration.
        Dash(std::boxed::Box<crate::model::manifest::DashConfig>),
    }
}

/// A Pub/Sub destination.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PubsubDestination {
    /// The name of the Pub/Sub topic to publish job completion notification
    /// to. For example: `projects/{project}/topics/{topic}`.
    pub topic: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl PubsubDestination {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [topic][crate::model::PubsubDestination::topic].
    pub fn set_topic<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.topic = v.into();
        self
    }
}

impl wkt::message::Message for PubsubDestination {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.transcoder.v1.PubsubDestination"
    }
}

/// Sprite sheet configuration.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SpriteSheet {
    /// Format type. The default is `jpeg`.
    ///
    /// Supported formats:
    ///
    /// - `jpeg`
    pub format: std::string::String,

    /// Required. File name prefix for the generated sprite sheets.
    ///
    /// Each sprite sheet has an incremental 10-digit zero-padded suffix starting
    /// from 0 before the extension, such as `sprite_sheet0000000123.jpeg`.
    pub file_prefix: std::string::String,

    /// Required. The width of sprite in pixels. Must be an even integer. To
    /// preserve the source aspect ratio, set the
    /// [SpriteSheet.sprite_width_pixels][google.cloud.video.transcoder.v1.SpriteSheet.sprite_width_pixels]
    /// field or the
    /// [SpriteSheet.sprite_height_pixels][google.cloud.video.transcoder.v1.SpriteSheet.sprite_height_pixels]
    /// field, but not both (the API will automatically calculate the missing
    /// field).
    ///
    /// For portrait videos that contain horizontal ASR and rotation metadata,
    /// provide the width, in pixels, per the horizontal ASR. The API calculates
    /// the height per the horizontal ASR. The API detects any rotation metadata
    /// and swaps the requested height and width for the output.
    ///
    /// [google.cloud.video.transcoder.v1.SpriteSheet.sprite_height_pixels]: crate::model::SpriteSheet::sprite_height_pixels
    /// [google.cloud.video.transcoder.v1.SpriteSheet.sprite_width_pixels]: crate::model::SpriteSheet::sprite_width_pixels
    pub sprite_width_pixels: i32,

    /// Required. The height of sprite in pixels. Must be an even integer. To
    /// preserve the source aspect ratio, set the
    /// [SpriteSheet.sprite_height_pixels][google.cloud.video.transcoder.v1.SpriteSheet.sprite_height_pixels]
    /// field or the
    /// [SpriteSheet.sprite_width_pixels][google.cloud.video.transcoder.v1.SpriteSheet.sprite_width_pixels]
    /// field, but not both (the API will automatically calculate the missing
    /// field).
    ///
    /// For portrait videos that contain horizontal ASR and rotation metadata,
    /// provide the height, in pixels, per the horizontal ASR. The API calculates
    /// the width per the horizontal ASR. The API detects any rotation metadata
    /// and swaps the requested height and width for the output.
    ///
    /// [google.cloud.video.transcoder.v1.SpriteSheet.sprite_height_pixels]: crate::model::SpriteSheet::sprite_height_pixels
    /// [google.cloud.video.transcoder.v1.SpriteSheet.sprite_width_pixels]: crate::model::SpriteSheet::sprite_width_pixels
    pub sprite_height_pixels: i32,

    /// The maximum number of sprites per row in a sprite sheet. The default is 0,
    /// which indicates no maximum limit.
    pub column_count: i32,

    /// The maximum number of rows per sprite sheet. When the sprite sheet is full,
    /// a new sprite sheet is created. The default is 0, which indicates no maximum
    /// limit.
    pub row_count: i32,

    /// Start time in seconds, relative to the output file timeline. Determines the
    /// first sprite to pick. The default is `0s`.
    pub start_time_offset: std::option::Option<wkt::Duration>,

    /// End time in seconds, relative to the output file timeline. When
    /// `end_time_offset` is not specified, the sprites are generated until the end
    /// of the output file.
    pub end_time_offset: std::option::Option<wkt::Duration>,

    /// The quality of the generated sprite sheet. Enter a value between 1
    /// and 100, where 1 is the lowest quality and 100 is the highest quality.
    /// The default is 100. A high quality value corresponds to a low image data
    /// compression ratio.
    pub quality: i32,

    /// Specify either total number of sprites or interval to create sprites.
    pub extraction_strategy: std::option::Option<crate::model::sprite_sheet::ExtractionStrategy>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl SpriteSheet {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [format][crate::model::SpriteSheet::format].
    pub fn set_format<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.format = v.into();
        self
    }

    /// Sets the value of [file_prefix][crate::model::SpriteSheet::file_prefix].
    pub fn set_file_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.file_prefix = v.into();
        self
    }

    /// Sets the value of [sprite_width_pixels][crate::model::SpriteSheet::sprite_width_pixels].
    pub fn set_sprite_width_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.sprite_width_pixels = v.into();
        self
    }

    /// Sets the value of [sprite_height_pixels][crate::model::SpriteSheet::sprite_height_pixels].
    pub fn set_sprite_height_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.sprite_height_pixels = v.into();
        self
    }

    /// Sets the value of [column_count][crate::model::SpriteSheet::column_count].
    pub fn set_column_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.column_count = v.into();
        self
    }

    /// Sets the value of [row_count][crate::model::SpriteSheet::row_count].
    pub fn set_row_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.row_count = v.into();
        self
    }

    /// Sets the value of [start_time_offset][crate::model::SpriteSheet::start_time_offset].
    pub fn set_start_time_offset<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Duration>,
    {
        self.start_time_offset = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [start_time_offset][crate::model::SpriteSheet::start_time_offset].
    pub fn set_or_clear_start_time_offset<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Duration>,
    {
        self.start_time_offset = v.map(|x| x.into());
        self
    }

    /// Sets the value of [end_time_offset][crate::model::SpriteSheet::end_time_offset].
    pub fn set_end_time_offset<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Duration>,
    {
        self.end_time_offset = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [end_time_offset][crate::model::SpriteSheet::end_time_offset].
    pub fn set_or_clear_end_time_offset<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Duration>,
    {
        self.end_time_offset = v.map(|x| x.into());
        self
    }

    /// Sets the value of [quality][crate::model::SpriteSheet::quality].
    pub fn set_quality<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.quality = v.into();
        self
    }

    /// Sets the value of [extraction_strategy][crate::model::SpriteSheet::extraction_strategy].
    ///
    /// Note that all the setters affecting `extraction_strategy` are mutually
    /// exclusive.
    pub fn set_extraction_strategy<
        T: std::convert::Into<std::option::Option<crate::model::sprite_sheet::ExtractionStrategy>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.extraction_strategy = v.into();
        self
    }

    /// The value of [extraction_strategy][crate::model::SpriteSheet::extraction_strategy]
    /// if it holds a `TotalCount`, `None` if the field is not set or
    /// holds a different branch.
    pub fn total_count(&self) -> std::option::Option<&i32> {
        #[allow(unreachable_patterns)]
        self.extraction_strategy.as_ref().and_then(|v| match v {
            crate::model::sprite_sheet::ExtractionStrategy::TotalCount(v) => {
                std::option::Option::Some(v)
            }
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [extraction_strategy][crate::model::SpriteSheet::extraction_strategy]
    /// to hold a `TotalCount`.
    ///
    /// Note that all the setters affecting `extraction_strategy` are
    /// mutually exclusive.
    pub fn set_total_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.extraction_strategy = std::option::Option::Some(
            crate::model::sprite_sheet::ExtractionStrategy::TotalCount(v.into()),
        );
        self
    }

    /// The value of [extraction_strategy][crate::model::SpriteSheet::extraction_strategy]
    /// if it holds a `Interval`, `None` if the field is not set or
    /// holds a different branch.
    pub fn interval(&self) -> std::option::Option<&std::boxed::Box<wkt::Duration>> {
        #[allow(unreachable_patterns)]
        self.extraction_strategy.as_ref().and_then(|v| match v {
            crate::model::sprite_sheet::ExtractionStrategy::Interval(v) => {
                std::option::Option::Some(v)
            }
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [extraction_strategy][crate::model::SpriteSheet::extraction_strategy]
    /// to hold a `Interval`.
    ///
    /// Note that all the setters affecting `extraction_strategy` are
    /// mutually exclusive.
    pub fn set_interval<T: std::convert::Into<std::boxed::Box<wkt::Duration>>>(
        mut self,
        v: T,
    ) -> Self {
        self.extraction_strategy = std::option::Option::Some(
            crate::model::sprite_sheet::ExtractionStrategy::Interval(v.into()),
        );
        self
    }
}

impl wkt::message::Message for SpriteSheet {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.transcoder.v1.SpriteSheet"
    }
}

/// Defines additional types related to [SpriteSheet].
pub mod sprite_sheet {
    #[allow(unused_imports)]
    use super::*;

    /// Specify either total number of sprites or interval to create sprites.
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum ExtractionStrategy {
        /// Total number of sprites. Create the specified number of sprites
        /// distributed evenly across the timeline of the output media. The default
        /// is 100.
        TotalCount(i32),
        /// Starting from `0s`, create sprites at regular intervals. Specify the
        /// interval value in seconds.
        Interval(std::boxed::Box<wkt::Duration>),
    }
}

/// Overlay configuration.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Overlay {
    /// Image overlay.
    pub image: std::option::Option<crate::model::overlay::Image>,

    /// List of animations. The list should be chronological, without any time
    /// overlap.
    pub animations: std::vec::Vec<crate::model::overlay::Animation>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Overlay {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [image][crate::model::Overlay::image].
    pub fn set_image<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::overlay::Image>,
    {
        self.image = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [image][crate::model::Overlay::image].
    pub fn set_or_clear_image<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::overlay::Image>,
    {
        self.image = v.map(|x| x.into());
        self
    }

    /// Sets the value of [animations][crate::model::Overlay::animations].
    pub fn set_animations<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::overlay::Animation>,
    {
        use std::iter::Iterator;
        self.animations = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for Overlay {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.transcoder.v1.Overlay"
    }
}

/// Defines additional types related to [Overlay].
pub mod overlay {
    #[allow(unused_imports)]
    use super::*;

    /// 2D normalized coordinates. Default: `{0.0, 0.0}`
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct NormalizedCoordinate {
        /// Normalized x coordinate.
        pub x: f64,

        /// Normalized y coordinate.
        pub y: f64,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl NormalizedCoordinate {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [x][crate::model::overlay::NormalizedCoordinate::x].
        pub fn set_x<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
            self.x = v.into();
            self
        }

        /// Sets the value of [y][crate::model::overlay::NormalizedCoordinate::y].
        pub fn set_y<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
            self.y = v.into();
            self
        }
    }

    impl wkt::message::Message for NormalizedCoordinate {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.video.transcoder.v1.Overlay.NormalizedCoordinate"
        }
    }

    /// Overlaid image.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct Image {
        /// Required. URI of the image in Cloud Storage. For example,
        /// `gs://bucket/inputs/image.png`. Only PNG and JPEG images are supported.
        pub uri: std::string::String,

        /// Normalized image resolution, based on output video resolution. Valid
        /// values: `0.0`–`1.0`. To respect the original image aspect ratio, set
        /// either `x` or `y` to `0.0`. To use the original image resolution, set
        /// both `x` and `y` to `0.0`.
        pub resolution: std::option::Option<crate::model::overlay::NormalizedCoordinate>,

        /// Target image opacity. Valid values are from  `1.0` (solid, default) to
        /// `0.0` (transparent), exclusive. Set this to a value greater than `0.0`.
        pub alpha: f64,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl Image {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [uri][crate::model::overlay::Image::uri].
        pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.uri = v.into();
            self
        }

        /// Sets the value of [resolution][crate::model::overlay::Image::resolution].
        pub fn set_resolution<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::overlay::NormalizedCoordinate>,
        {
            self.resolution = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [resolution][crate::model::overlay::Image::resolution].
        pub fn set_or_clear_resolution<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::overlay::NormalizedCoordinate>,
        {
            self.resolution = v.map(|x| x.into());
            self
        }

        /// Sets the value of [alpha][crate::model::overlay::Image::alpha].
        pub fn set_alpha<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
            self.alpha = v.into();
            self
        }
    }

    impl wkt::message::Message for Image {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.video.transcoder.v1.Overlay.Image"
        }
    }

    /// Display static overlay object.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct AnimationStatic {
        /// Normalized coordinates based on output video resolution. Valid
        /// values: `0.0`–`1.0`. `xy` is the upper-left coordinate of the overlay
        /// object. For example, use the x and y coordinates {0,0} to position the
        /// top-left corner of the overlay animation in the top-left corner of the
        /// output video.
        pub xy: std::option::Option<crate::model::overlay::NormalizedCoordinate>,

        /// The time to start displaying the overlay object, in seconds. Default: 0
        pub start_time_offset: std::option::Option<wkt::Duration>,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl AnimationStatic {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [xy][crate::model::overlay::AnimationStatic::xy].
        pub fn set_xy<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::overlay::NormalizedCoordinate>,
        {
            self.xy = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [xy][crate::model::overlay::AnimationStatic::xy].
        pub fn set_or_clear_xy<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::overlay::NormalizedCoordinate>,
        {
            self.xy = v.map(|x| x.into());
            self
        }

        /// Sets the value of [start_time_offset][crate::model::overlay::AnimationStatic::start_time_offset].
        pub fn set_start_time_offset<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<wkt::Duration>,
        {
            self.start_time_offset = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [start_time_offset][crate::model::overlay::AnimationStatic::start_time_offset].
        pub fn set_or_clear_start_time_offset<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<wkt::Duration>,
        {
            self.start_time_offset = v.map(|x| x.into());
            self
        }
    }

    impl wkt::message::Message for AnimationStatic {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.video.transcoder.v1.Overlay.AnimationStatic"
        }
    }

    /// Display overlay object with fade animation.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct AnimationFade {
        /// Required. Type of fade animation: `FADE_IN` or `FADE_OUT`.
        pub fade_type: crate::model::overlay::FadeType,

        /// Normalized coordinates based on output video resolution. Valid
        /// values: `0.0`–`1.0`. `xy` is the upper-left coordinate of the overlay
        /// object. For example, use the x and y coordinates {0,0} to position the
        /// top-left corner of the overlay animation in the top-left corner of the
        /// output video.
        pub xy: std::option::Option<crate::model::overlay::NormalizedCoordinate>,

        /// The time to start the fade animation, in seconds. Default: 0
        pub start_time_offset: std::option::Option<wkt::Duration>,

        /// The time to end the fade animation, in seconds. Default:
        /// `start_time_offset` + 1s
        pub end_time_offset: std::option::Option<wkt::Duration>,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl AnimationFade {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [fade_type][crate::model::overlay::AnimationFade::fade_type].
        pub fn set_fade_type<T: std::convert::Into<crate::model::overlay::FadeType>>(
            mut self,
            v: T,
        ) -> Self {
            self.fade_type = v.into();
            self
        }

        /// Sets the value of [xy][crate::model::overlay::AnimationFade::xy].
        pub fn set_xy<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::overlay::NormalizedCoordinate>,
        {
            self.xy = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [xy][crate::model::overlay::AnimationFade::xy].
        pub fn set_or_clear_xy<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::overlay::NormalizedCoordinate>,
        {
            self.xy = v.map(|x| x.into());
            self
        }

        /// Sets the value of [start_time_offset][crate::model::overlay::AnimationFade::start_time_offset].
        pub fn set_start_time_offset<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<wkt::Duration>,
        {
            self.start_time_offset = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [start_time_offset][crate::model::overlay::AnimationFade::start_time_offset].
        pub fn set_or_clear_start_time_offset<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<wkt::Duration>,
        {
            self.start_time_offset = v.map(|x| x.into());
            self
        }

        /// Sets the value of [end_time_offset][crate::model::overlay::AnimationFade::end_time_offset].
        pub fn set_end_time_offset<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<wkt::Duration>,
        {
            self.end_time_offset = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [end_time_offset][crate::model::overlay::AnimationFade::end_time_offset].
        pub fn set_or_clear_end_time_offset<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<wkt::Duration>,
        {
            self.end_time_offset = v.map(|x| x.into());
            self
        }
    }

    impl wkt::message::Message for AnimationFade {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.video.transcoder.v1.Overlay.AnimationFade"
        }
    }

    /// End previous overlay animation from the video. Without `AnimationEnd`, the
    /// overlay object will keep the state of previous animation until the end of
    /// the video.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct AnimationEnd {
        /// The time to end overlay object, in seconds. Default: 0
        pub start_time_offset: std::option::Option<wkt::Duration>,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl AnimationEnd {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [start_time_offset][crate::model::overlay::AnimationEnd::start_time_offset].
        pub fn set_start_time_offset<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<wkt::Duration>,
        {
            self.start_time_offset = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [start_time_offset][crate::model::overlay::AnimationEnd::start_time_offset].
        pub fn set_or_clear_start_time_offset<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<wkt::Duration>,
        {
            self.start_time_offset = v.map(|x| x.into());
            self
        }
    }

    impl wkt::message::Message for AnimationEnd {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.video.transcoder.v1.Overlay.AnimationEnd"
        }
    }

    /// Animation types.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct Animation {
        /// Animations can be static or fade, or they can end the previous animation.
        pub animation_type: std::option::Option<crate::model::overlay::animation::AnimationType>,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl Animation {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [animation_type][crate::model::overlay::Animation::animation_type].
        ///
        /// Note that all the setters affecting `animation_type` are mutually
        /// exclusive.
        pub fn set_animation_type<
            T: std::convert::Into<
                    std::option::Option<crate::model::overlay::animation::AnimationType>,
                >,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.animation_type = v.into();
            self
        }

        /// The value of [animation_type][crate::model::overlay::Animation::animation_type]
        /// if it holds a `AnimationStatic`, `None` if the field is not set or
        /// holds a different branch.
        pub fn animation_static(
            &self,
        ) -> std::option::Option<&std::boxed::Box<crate::model::overlay::AnimationStatic>> {
            #[allow(unreachable_patterns)]
            self.animation_type.as_ref().and_then(|v| match v {
                crate::model::overlay::animation::AnimationType::AnimationStatic(v) => {
                    std::option::Option::Some(v)
                }
                _ => std::option::Option::None,
            })
        }

        /// Sets the value of [animation_type][crate::model::overlay::Animation::animation_type]
        /// to hold a `AnimationStatic`.
        ///
        /// Note that all the setters affecting `animation_type` are
        /// mutually exclusive.
        pub fn set_animation_static<
            T: std::convert::Into<std::boxed::Box<crate::model::overlay::AnimationStatic>>,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.animation_type = std::option::Option::Some(
                crate::model::overlay::animation::AnimationType::AnimationStatic(v.into()),
            );
            self
        }

        /// The value of [animation_type][crate::model::overlay::Animation::animation_type]
        /// if it holds a `AnimationFade`, `None` if the field is not set or
        /// holds a different branch.
        pub fn animation_fade(
            &self,
        ) -> std::option::Option<&std::boxed::Box<crate::model::overlay::AnimationFade>> {
            #[allow(unreachable_patterns)]
            self.animation_type.as_ref().and_then(|v| match v {
                crate::model::overlay::animation::AnimationType::AnimationFade(v) => {
                    std::option::Option::Some(v)
                }
                _ => std::option::Option::None,
            })
        }

        /// Sets the value of [animation_type][crate::model::overlay::Animation::animation_type]
        /// to hold a `AnimationFade`.
        ///
        /// Note that all the setters affecting `animation_type` are
        /// mutually exclusive.
        pub fn set_animation_fade<
            T: std::convert::Into<std::boxed::Box<crate::model::overlay::AnimationFade>>,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.animation_type = std::option::Option::Some(
                crate::model::overlay::animation::AnimationType::AnimationFade(v.into()),
            );
            self
        }

        /// The value of [animation_type][crate::model::overlay::Animation::animation_type]
        /// if it holds a `AnimationEnd`, `None` if the field is not set or
        /// holds a different branch.
        pub fn animation_end(
            &self,
        ) -> std::option::Option<&std::boxed::Box<crate::model::overlay::AnimationEnd>> {
            #[allow(unreachable_patterns)]
            self.animation_type.as_ref().and_then(|v| match v {
                crate::model::overlay::animation::AnimationType::AnimationEnd(v) => {
                    std::option::Option::Some(v)
                }
                _ => std::option::Option::None,
            })
        }

        /// Sets the value of [animation_type][crate::model::overlay::Animation::animation_type]
        /// to hold a `AnimationEnd`.
        ///
        /// Note that all the setters affecting `animation_type` are
        /// mutually exclusive.
        pub fn set_animation_end<
            T: std::convert::Into<std::boxed::Box<crate::model::overlay::AnimationEnd>>,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.animation_type = std::option::Option::Some(
                crate::model::overlay::animation::AnimationType::AnimationEnd(v.into()),
            );
            self
        }
    }

    impl wkt::message::Message for Animation {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.video.transcoder.v1.Overlay.Animation"
        }
    }

    /// Defines additional types related to [Animation].
    pub mod animation {
        #[allow(unused_imports)]
        use super::*;

        /// Animations can be static or fade, or they can end the previous animation.
        #[derive(Clone, Debug, PartialEq)]
        #[non_exhaustive]
        pub enum AnimationType {
            /// Display static overlay object.
            AnimationStatic(std::boxed::Box<crate::model::overlay::AnimationStatic>),
            /// Display overlay object with fade animation.
            AnimationFade(std::boxed::Box<crate::model::overlay::AnimationFade>),
            /// End previous animation.
            AnimationEnd(std::boxed::Box<crate::model::overlay::AnimationEnd>),
        }
    }

    /// Fade type for the overlay: `FADE_IN` or `FADE_OUT`.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum FadeType {
        /// The fade type is not specified.
        Unspecified,
        /// Fade the overlay object into view.
        FadeIn,
        /// Fade the overlay object out of view.
        FadeOut,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [FadeType::value] or
        /// [FadeType::name].
        UnknownValue(fade_type::UnknownValue),
    }

    #[doc(hidden)]
    pub mod fade_type {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl FadeType {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::FadeIn => std::option::Option::Some(1),
                Self::FadeOut => std::option::Option::Some(2),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("FADE_TYPE_UNSPECIFIED"),
                Self::FadeIn => std::option::Option::Some("FADE_IN"),
                Self::FadeOut => std::option::Option::Some("FADE_OUT"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for FadeType {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for FadeType {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for FadeType {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::FadeIn,
                2 => Self::FadeOut,
                _ => Self::UnknownValue(fade_type::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for FadeType {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "FADE_TYPE_UNSPECIFIED" => Self::Unspecified,
                "FADE_IN" => Self::FadeIn,
                "FADE_OUT" => Self::FadeOut,
                _ => Self::UnknownValue(fade_type::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for FadeType {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::FadeIn => serializer.serialize_i32(1),
                Self::FadeOut => serializer.serialize_i32(2),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for FadeType {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<FadeType>::new(
                ".google.cloud.video.transcoder.v1.Overlay.FadeType",
            ))
        }
    }
}

/// Preprocessing configurations.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PreprocessingConfig {
    /// Color preprocessing configuration.
    pub color: std::option::Option<crate::model::preprocessing_config::Color>,

    /// Denoise preprocessing configuration.
    pub denoise: std::option::Option<crate::model::preprocessing_config::Denoise>,

    /// Deblock preprocessing configuration.
    pub deblock: std::option::Option<crate::model::preprocessing_config::Deblock>,

    /// Audio preprocessing configuration.
    pub audio: std::option::Option<crate::model::preprocessing_config::Audio>,

    /// Specify the video cropping configuration.
    pub crop: std::option::Option<crate::model::preprocessing_config::Crop>,

    /// Specify the video pad filter configuration.
    pub pad: std::option::Option<crate::model::preprocessing_config::Pad>,

    /// Specify the video deinterlace configuration.
    pub deinterlace: std::option::Option<crate::model::preprocessing_config::Deinterlace>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl PreprocessingConfig {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [color][crate::model::PreprocessingConfig::color].
    pub fn set_color<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::preprocessing_config::Color>,
    {
        self.color = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [color][crate::model::PreprocessingConfig::color].
    pub fn set_or_clear_color<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::preprocessing_config::Color>,
    {
        self.color = v.map(|x| x.into());
        self
    }

    /// Sets the value of [denoise][crate::model::PreprocessingConfig::denoise].
    pub fn set_denoise<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::preprocessing_config::Denoise>,
    {
        self.denoise = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [denoise][crate::model::PreprocessingConfig::denoise].
    pub fn set_or_clear_denoise<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::preprocessing_config::Denoise>,
    {
        self.denoise = v.map(|x| x.into());
        self
    }

    /// Sets the value of [deblock][crate::model::PreprocessingConfig::deblock].
    pub fn set_deblock<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::preprocessing_config::Deblock>,
    {
        self.deblock = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [deblock][crate::model::PreprocessingConfig::deblock].
    pub fn set_or_clear_deblock<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::preprocessing_config::Deblock>,
    {
        self.deblock = v.map(|x| x.into());
        self
    }

    /// Sets the value of [audio][crate::model::PreprocessingConfig::audio].
    pub fn set_audio<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::preprocessing_config::Audio>,
    {
        self.audio = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [audio][crate::model::PreprocessingConfig::audio].
    pub fn set_or_clear_audio<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::preprocessing_config::Audio>,
    {
        self.audio = v.map(|x| x.into());
        self
    }

    /// Sets the value of [crop][crate::model::PreprocessingConfig::crop].
    pub fn set_crop<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::preprocessing_config::Crop>,
    {
        self.crop = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [crop][crate::model::PreprocessingConfig::crop].
    pub fn set_or_clear_crop<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::preprocessing_config::Crop>,
    {
        self.crop = v.map(|x| x.into());
        self
    }

    /// Sets the value of [pad][crate::model::PreprocessingConfig::pad].
    pub fn set_pad<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::preprocessing_config::Pad>,
    {
        self.pad = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [pad][crate::model::PreprocessingConfig::pad].
    pub fn set_or_clear_pad<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::preprocessing_config::Pad>,
    {
        self.pad = v.map(|x| x.into());
        self
    }

    /// Sets the value of [deinterlace][crate::model::PreprocessingConfig::deinterlace].
    pub fn set_deinterlace<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::preprocessing_config::Deinterlace>,
    {
        self.deinterlace = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [deinterlace][crate::model::PreprocessingConfig::deinterlace].
    pub fn set_or_clear_deinterlace<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::preprocessing_config::Deinterlace>,
    {
        self.deinterlace = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for PreprocessingConfig {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.transcoder.v1.PreprocessingConfig"
    }
}

/// Defines additional types related to [PreprocessingConfig].
pub mod preprocessing_config {
    #[allow(unused_imports)]
    use super::*;

    /// Color preprocessing configuration.
    ///
    /// **Note:** This configuration is not supported.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct Color {
        /// Control color saturation of the video. Enter a value between -1 and 1,
        /// where -1 is fully desaturated and 1 is maximum saturation. 0 is no
        /// change. The default is 0.
        pub saturation: f64,

        /// Control black and white contrast of the video. Enter a value between -1
        /// and 1, where -1 is minimum contrast and 1 is maximum contrast. 0 is no
        /// change. The default is 0.
        pub contrast: f64,

        /// Control brightness of the video. Enter a value between -1 and 1, where -1
        /// is minimum brightness and 1 is maximum brightness. 0 is no change. The
        /// default is 0.
        pub brightness: f64,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl Color {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [saturation][crate::model::preprocessing_config::Color::saturation].
        pub fn set_saturation<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
            self.saturation = v.into();
            self
        }

        /// Sets the value of [contrast][crate::model::preprocessing_config::Color::contrast].
        pub fn set_contrast<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
            self.contrast = v.into();
            self
        }

        /// Sets the value of [brightness][crate::model::preprocessing_config::Color::brightness].
        pub fn set_brightness<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
            self.brightness = v.into();
            self
        }
    }

    impl wkt::message::Message for Color {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.video.transcoder.v1.PreprocessingConfig.Color"
        }
    }

    /// Denoise preprocessing configuration.
    ///
    /// **Note:** This configuration is not supported.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct Denoise {
        /// Set strength of the denoise. Enter a value between 0 and 1. The higher
        /// the value, the smoother the image. 0 is no denoising. The default is 0.
        pub strength: f64,

        /// Set the denoiser mode. The default is `standard`.
        ///
        /// Supported denoiser modes:
        ///
        /// - `standard`
        /// - `grain`
        pub tune: std::string::String,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl Denoise {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [strength][crate::model::preprocessing_config::Denoise::strength].
        pub fn set_strength<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
            self.strength = v.into();
            self
        }

        /// Sets the value of [tune][crate::model::preprocessing_config::Denoise::tune].
        pub fn set_tune<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.tune = v.into();
            self
        }
    }

    impl wkt::message::Message for Denoise {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.video.transcoder.v1.PreprocessingConfig.Denoise"
        }
    }

    /// Deblock preprocessing configuration.
    ///
    /// **Note:** This configuration is not supported.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct Deblock {
        /// Set strength of the deblocker. Enter a value between 0 and 1. The higher
        /// the value, the stronger the block removal. 0 is no deblocking. The
        /// default is 0.
        pub strength: f64,

        /// Enable deblocker. The default is `false`.
        pub enabled: bool,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl Deblock {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [strength][crate::model::preprocessing_config::Deblock::strength].
        pub fn set_strength<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
            self.strength = v.into();
            self
        }

        /// Sets the value of [enabled][crate::model::preprocessing_config::Deblock::enabled].
        pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
            self.enabled = v.into();
            self
        }
    }

    impl wkt::message::Message for Deblock {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.video.transcoder.v1.PreprocessingConfig.Deblock"
        }
    }

    /// Audio preprocessing configuration.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct Audio {
        /// Specify audio loudness normalization in loudness units relative to full
        /// scale (LUFS). Enter a value between -24 and 0 (the default), where:
        ///
        /// * -24 is the Advanced Television Systems Committee (ATSC A/85) standard
        /// * -23 is the EU R128 broadcast standard
        /// * -19 is the prior standard for online mono audio
        /// * -18 is the ReplayGain standard
        /// * -16 is the prior standard for stereo audio
        /// * -14 is the new online audio standard recommended by Spotify, as well
        ///   as Amazon Echo
        /// * 0 disables normalization
        pub lufs: f64,

        /// Enable boosting high frequency components. The default is `false`.
        ///
        /// **Note:** This field is not supported.
        pub high_boost: bool,

        /// Enable boosting low frequency components. The default is `false`.
        ///
        /// **Note:** This field is not supported.
        pub low_boost: bool,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl Audio {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [lufs][crate::model::preprocessing_config::Audio::lufs].
        pub fn set_lufs<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
            self.lufs = v.into();
            self
        }

        /// Sets the value of [high_boost][crate::model::preprocessing_config::Audio::high_boost].
        pub fn set_high_boost<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
            self.high_boost = v.into();
            self
        }

        /// Sets the value of [low_boost][crate::model::preprocessing_config::Audio::low_boost].
        pub fn set_low_boost<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
            self.low_boost = v.into();
            self
        }
    }

    impl wkt::message::Message for Audio {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.video.transcoder.v1.PreprocessingConfig.Audio"
        }
    }

    /// Video cropping configuration for the input video. The cropped input video
    /// is scaled to match the output resolution.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct Crop {
        /// The number of pixels to crop from the top. The default is 0.
        pub top_pixels: i32,

        /// The number of pixels to crop from the bottom. The default is 0.
        pub bottom_pixels: i32,

        /// The number of pixels to crop from the left. The default is 0.
        pub left_pixels: i32,

        /// The number of pixels to crop from the right. The default is 0.
        pub right_pixels: i32,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl Crop {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [top_pixels][crate::model::preprocessing_config::Crop::top_pixels].
        pub fn set_top_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
            self.top_pixels = v.into();
            self
        }

        /// Sets the value of [bottom_pixels][crate::model::preprocessing_config::Crop::bottom_pixels].
        pub fn set_bottom_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
            self.bottom_pixels = v.into();
            self
        }

        /// Sets the value of [left_pixels][crate::model::preprocessing_config::Crop::left_pixels].
        pub fn set_left_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
            self.left_pixels = v.into();
            self
        }

        /// Sets the value of [right_pixels][crate::model::preprocessing_config::Crop::right_pixels].
        pub fn set_right_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
            self.right_pixels = v.into();
            self
        }
    }

    impl wkt::message::Message for Crop {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.video.transcoder.v1.PreprocessingConfig.Crop"
        }
    }

    /// Pad filter configuration for the input video. The padded input video
    /// is scaled after padding with black to match the output resolution.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct Pad {
        /// The number of pixels to add to the top. The default is 0.
        pub top_pixels: i32,

        /// The number of pixels to add to the bottom. The default is 0.
        pub bottom_pixels: i32,

        /// The number of pixels to add to the left. The default is 0.
        pub left_pixels: i32,

        /// The number of pixels to add to the right. The default is 0.
        pub right_pixels: i32,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl Pad {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [top_pixels][crate::model::preprocessing_config::Pad::top_pixels].
        pub fn set_top_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
            self.top_pixels = v.into();
            self
        }

        /// Sets the value of [bottom_pixels][crate::model::preprocessing_config::Pad::bottom_pixels].
        pub fn set_bottom_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
            self.bottom_pixels = v.into();
            self
        }

        /// Sets the value of [left_pixels][crate::model::preprocessing_config::Pad::left_pixels].
        pub fn set_left_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
            self.left_pixels = v.into();
            self
        }

        /// Sets the value of [right_pixels][crate::model::preprocessing_config::Pad::right_pixels].
        pub fn set_right_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
            self.right_pixels = v.into();
            self
        }
    }

    impl wkt::message::Message for Pad {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.video.transcoder.v1.PreprocessingConfig.Pad"
        }
    }

    /// Deinterlace configuration for input video.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct Deinterlace {
        /// Specify the video deinterlacing filter. The default is `yadif`.
        pub deinterlacing_filter: std::option::Option<
            crate::model::preprocessing_config::deinterlace::DeinterlacingFilter,
        >,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl Deinterlace {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [deinterlacing_filter][crate::model::preprocessing_config::Deinterlace::deinterlacing_filter].
        ///
        /// Note that all the setters affecting `deinterlacing_filter` are mutually
        /// exclusive.
        pub fn set_deinterlacing_filter<
            T: std::convert::Into<
                    std::option::Option<
                        crate::model::preprocessing_config::deinterlace::DeinterlacingFilter,
                    >,
                >,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.deinterlacing_filter = v.into();
            self
        }

        /// The value of [deinterlacing_filter][crate::model::preprocessing_config::Deinterlace::deinterlacing_filter]
        /// if it holds a `Yadif`, `None` if the field is not set or
        /// holds a different branch.
        pub fn yadif(
            &self,
        ) -> std::option::Option<
            &std::boxed::Box<crate::model::preprocessing_config::deinterlace::YadifConfig>,
        > {
            #[allow(unreachable_patterns)]
            self.deinterlacing_filter.as_ref().and_then(|v| match v {
                crate::model::preprocessing_config::deinterlace::DeinterlacingFilter::Yadif(v) => {
                    std::option::Option::Some(v)
                }
                _ => std::option::Option::None,
            })
        }

        /// Sets the value of [deinterlacing_filter][crate::model::preprocessing_config::Deinterlace::deinterlacing_filter]
        /// to hold a `Yadif`.
        ///
        /// Note that all the setters affecting `deinterlacing_filter` are
        /// mutually exclusive.
        pub fn set_yadif<
            T: std::convert::Into<
                    std::boxed::Box<crate::model::preprocessing_config::deinterlace::YadifConfig>,
                >,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.deinterlacing_filter = std::option::Option::Some(
                crate::model::preprocessing_config::deinterlace::DeinterlacingFilter::Yadif(
                    v.into(),
                ),
            );
            self
        }

        /// The value of [deinterlacing_filter][crate::model::preprocessing_config::Deinterlace::deinterlacing_filter]
        /// if it holds a `Bwdif`, `None` if the field is not set or
        /// holds a different branch.
        pub fn bwdif(
            &self,
        ) -> std::option::Option<
            &std::boxed::Box<crate::model::preprocessing_config::deinterlace::BwdifConfig>,
        > {
            #[allow(unreachable_patterns)]
            self.deinterlacing_filter.as_ref().and_then(|v| match v {
                crate::model::preprocessing_config::deinterlace::DeinterlacingFilter::Bwdif(v) => {
                    std::option::Option::Some(v)
                }
                _ => std::option::Option::None,
            })
        }

        /// Sets the value of [deinterlacing_filter][crate::model::preprocessing_config::Deinterlace::deinterlacing_filter]
        /// to hold a `Bwdif`.
        ///
        /// Note that all the setters affecting `deinterlacing_filter` are
        /// mutually exclusive.
        pub fn set_bwdif<
            T: std::convert::Into<
                    std::boxed::Box<crate::model::preprocessing_config::deinterlace::BwdifConfig>,
                >,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.deinterlacing_filter = std::option::Option::Some(
                crate::model::preprocessing_config::deinterlace::DeinterlacingFilter::Bwdif(
                    v.into(),
                ),
            );
            self
        }
    }

    impl wkt::message::Message for Deinterlace {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.video.transcoder.v1.PreprocessingConfig.Deinterlace"
        }
    }

    /// Defines additional types related to [Deinterlace].
    pub mod deinterlace {
        #[allow(unused_imports)]
        use super::*;

        /// Yet Another Deinterlacing Filter Configuration.
        #[derive(Clone, Default, PartialEq)]
        #[non_exhaustive]
        pub struct YadifConfig {
            /// Specifies the deinterlacing mode to adopt.
            /// The default is `send_frame`.
            /// Supported values:
            ///
            /// - `send_frame`: Output one frame for each frame
            /// - `send_field`: Output one frame for each field
            pub mode: std::string::String,

            /// Disable spacial interlacing.
            /// The default is `false`.
            pub disable_spatial_interlacing: bool,

            /// The picture field parity assumed for the input interlaced video.
            /// The default is `auto`.
            /// Supported values:
            ///
            /// - `tff`: Assume the top field is first
            /// - `bff`: Assume the bottom field is first
            /// - `auto`: Enable automatic detection of field parity
            pub parity: std::string::String,

            /// Deinterlace all frames rather than just the frames identified as
            /// interlaced. The default is `false`.
            pub deinterlace_all_frames: bool,

            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
        }

        impl YadifConfig {
            pub fn new() -> Self {
                std::default::Default::default()
            }

            /// Sets the value of [mode][crate::model::preprocessing_config::deinterlace::YadifConfig::mode].
            pub fn set_mode<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
                self.mode = v.into();
                self
            }

            /// Sets the value of [disable_spatial_interlacing][crate::model::preprocessing_config::deinterlace::YadifConfig::disable_spatial_interlacing].
            pub fn set_disable_spatial_interlacing<T: std::convert::Into<bool>>(
                mut self,
                v: T,
            ) -> Self {
                self.disable_spatial_interlacing = v.into();
                self
            }

            /// Sets the value of [parity][crate::model::preprocessing_config::deinterlace::YadifConfig::parity].
            pub fn set_parity<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
                self.parity = v.into();
                self
            }

            /// Sets the value of [deinterlace_all_frames][crate::model::preprocessing_config::deinterlace::YadifConfig::deinterlace_all_frames].
            pub fn set_deinterlace_all_frames<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
                self.deinterlace_all_frames = v.into();
                self
            }
        }

        impl wkt::message::Message for YadifConfig {
            fn typename() -> &'static str {
                "type.googleapis.com/google.cloud.video.transcoder.v1.PreprocessingConfig.Deinterlace.YadifConfig"
            }
        }

        /// Bob Weaver Deinterlacing Filter Configuration.
        #[derive(Clone, Default, PartialEq)]
        #[non_exhaustive]
        pub struct BwdifConfig {
            /// Specifies the deinterlacing mode to adopt.
            /// The default is `send_frame`.
            /// Supported values:
            ///
            /// - `send_frame`: Output one frame for each frame
            /// - `send_field`: Output one frame for each field
            pub mode: std::string::String,

            /// The picture field parity assumed for the input interlaced video.
            /// The default is `auto`.
            /// Supported values:
            ///
            /// - `tff`: Assume the top field is first
            /// - `bff`: Assume the bottom field is first
            /// - `auto`: Enable automatic detection of field parity
            pub parity: std::string::String,

            /// Deinterlace all frames rather than just the frames identified as
            /// interlaced. The default is `false`.
            pub deinterlace_all_frames: bool,

            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
        }

        impl BwdifConfig {
            pub fn new() -> Self {
                std::default::Default::default()
            }

            /// Sets the value of [mode][crate::model::preprocessing_config::deinterlace::BwdifConfig::mode].
            pub fn set_mode<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
                self.mode = v.into();
                self
            }

            /// Sets the value of [parity][crate::model::preprocessing_config::deinterlace::BwdifConfig::parity].
            pub fn set_parity<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
                self.parity = v.into();
                self
            }

            /// Sets the value of [deinterlace_all_frames][crate::model::preprocessing_config::deinterlace::BwdifConfig::deinterlace_all_frames].
            pub fn set_deinterlace_all_frames<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
                self.deinterlace_all_frames = v.into();
                self
            }
        }

        impl wkt::message::Message for BwdifConfig {
            fn typename() -> &'static str {
                "type.googleapis.com/google.cloud.video.transcoder.v1.PreprocessingConfig.Deinterlace.BwdifConfig"
            }
        }

        /// Specify the video deinterlacing filter. The default is `yadif`.
        #[derive(Clone, Debug, PartialEq)]
        #[non_exhaustive]
        pub enum DeinterlacingFilter {
            /// Specifies the Yet Another Deinterlacing Filter Configuration.
            Yadif(std::boxed::Box<crate::model::preprocessing_config::deinterlace::YadifConfig>),
            /// Specifies the Bob Weaver Deinterlacing Filter Configuration.
            Bwdif(std::boxed::Box<crate::model::preprocessing_config::deinterlace::BwdifConfig>),
        }
    }
}

/// Track definition for the input asset.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TrackDefinition {
    /// The input track.
    pub input_track: std::option::Option<i32>,

    /// Optional. A list of languages spoken in the input asset, represented by a
    /// BCP 47 language code, such as "en-US" or "sr-Latn". For more information,
    /// see <https://www.unicode.org/reports/tr35/#Unicode_locale_identifier>.
    pub languages: std::vec::Vec<std::string::String>,

    /// Optional. Whether to automatically detect the languages present in the
    /// track. If true, the system will attempt to identify all the languages
    /// present in the track and populate the languages field.
    pub detect_languages: bool,

    /// Output only. A list of languages detected in the input asset, represented
    /// by a BCP 47 language code, such as "en-US" or "sr-Latn". For more
    /// information, see
    /// <https://www.unicode.org/reports/tr35/#Unicode_locale_identifier>.
    /// This field is only populated if the detect_languages field is set to true.
    pub detected_languages: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl TrackDefinition {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [input_track][crate::model::TrackDefinition::input_track].
    pub fn set_input_track<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<i32>,
    {
        self.input_track = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [input_track][crate::model::TrackDefinition::input_track].
    pub fn set_or_clear_input_track<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<i32>,
    {
        self.input_track = v.map(|x| x.into());
        self
    }

    /// Sets the value of [languages][crate::model::TrackDefinition::languages].
    pub fn set_languages<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.languages = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [detect_languages][crate::model::TrackDefinition::detect_languages].
    pub fn set_detect_languages<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.detect_languages = v.into();
        self
    }

    /// Sets the value of [detected_languages][crate::model::TrackDefinition::detected_languages].
    pub fn set_detected_languages<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.detected_languages = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for TrackDefinition {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.transcoder.v1.TrackDefinition"
    }
}

/// Input attributes that provide additional information about the input asset.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct InputAttributes {
    /// Optional. A list of track definitions for the input asset.
    pub track_definitions: std::vec::Vec<crate::model::TrackDefinition>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl InputAttributes {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [track_definitions][crate::model::InputAttributes::track_definitions].
    pub fn set_track_definitions<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::TrackDefinition>,
    {
        use std::iter::Iterator;
        self.track_definitions = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for InputAttributes {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.transcoder.v1.InputAttributes"
    }
}

/// Video stream resource.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct VideoStream {
    /// Codec settings can be h264, h265, or vp9.
    pub codec_settings: std::option::Option<crate::model::video_stream::CodecSettings>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl VideoStream {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [codec_settings][crate::model::VideoStream::codec_settings].
    ///
    /// Note that all the setters affecting `codec_settings` are mutually
    /// exclusive.
    pub fn set_codec_settings<
        T: std::convert::Into<std::option::Option<crate::model::video_stream::CodecSettings>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.codec_settings = v.into();
        self
    }

    /// The value of [codec_settings][crate::model::VideoStream::codec_settings]
    /// if it holds a `H264`, `None` if the field is not set or
    /// holds a different branch.
    pub fn h264(
        &self,
    ) -> std::option::Option<&std::boxed::Box<crate::model::video_stream::H264CodecSettings>> {
        #[allow(unreachable_patterns)]
        self.codec_settings.as_ref().and_then(|v| match v {
            crate::model::video_stream::CodecSettings::H264(v) => std::option::Option::Some(v),
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [codec_settings][crate::model::VideoStream::codec_settings]
    /// to hold a `H264`.
    ///
    /// Note that all the setters affecting `codec_settings` are
    /// mutually exclusive.
    pub fn set_h264<
        T: std::convert::Into<std::boxed::Box<crate::model::video_stream::H264CodecSettings>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.codec_settings =
            std::option::Option::Some(crate::model::video_stream::CodecSettings::H264(v.into()));
        self
    }

    /// The value of [codec_settings][crate::model::VideoStream::codec_settings]
    /// if it holds a `H265`, `None` if the field is not set or
    /// holds a different branch.
    pub fn h265(
        &self,
    ) -> std::option::Option<&std::boxed::Box<crate::model::video_stream::H265CodecSettings>> {
        #[allow(unreachable_patterns)]
        self.codec_settings.as_ref().and_then(|v| match v {
            crate::model::video_stream::CodecSettings::H265(v) => std::option::Option::Some(v),
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [codec_settings][crate::model::VideoStream::codec_settings]
    /// to hold a `H265`.
    ///
    /// Note that all the setters affecting `codec_settings` are
    /// mutually exclusive.
    pub fn set_h265<
        T: std::convert::Into<std::boxed::Box<crate::model::video_stream::H265CodecSettings>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.codec_settings =
            std::option::Option::Some(crate::model::video_stream::CodecSettings::H265(v.into()));
        self
    }

    /// The value of [codec_settings][crate::model::VideoStream::codec_settings]
    /// if it holds a `Vp9`, `None` if the field is not set or
    /// holds a different branch.
    pub fn vp9(
        &self,
    ) -> std::option::Option<&std::boxed::Box<crate::model::video_stream::Vp9CodecSettings>> {
        #[allow(unreachable_patterns)]
        self.codec_settings.as_ref().and_then(|v| match v {
            crate::model::video_stream::CodecSettings::Vp9(v) => std::option::Option::Some(v),
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [codec_settings][crate::model::VideoStream::codec_settings]
    /// to hold a `Vp9`.
    ///
    /// Note that all the setters affecting `codec_settings` are
    /// mutually exclusive.
    pub fn set_vp9<
        T: std::convert::Into<std::boxed::Box<crate::model::video_stream::Vp9CodecSettings>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.codec_settings =
            std::option::Option::Some(crate::model::video_stream::CodecSettings::Vp9(v.into()));
        self
    }
}

impl wkt::message::Message for VideoStream {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream"
    }
}

/// Defines additional types related to [VideoStream].
pub mod video_stream {
    #[allow(unused_imports)]
    use super::*;

    /// Convert the input video to a Standard Dynamic Range (SDR) video.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct H264ColorFormatSDR {
        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl H264ColorFormatSDR {
        pub fn new() -> Self {
            std::default::Default::default()
        }
    }

    impl wkt::message::Message for H264ColorFormatSDR {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream.H264ColorFormatSDR"
        }
    }

    /// Convert the input video to a Hybrid Log Gamma (HLG) video.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct H264ColorFormatHLG {
        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl H264ColorFormatHLG {
        pub fn new() -> Self {
            std::default::Default::default()
        }
    }

    impl wkt::message::Message for H264ColorFormatHLG {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream.H264ColorFormatHLG"
        }
    }

    /// H264 codec settings.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct H264CodecSettings {
        /// The width of the video in pixels. Must be an even integer.
        /// When not specified, the width is adjusted to match the specified height
        /// and input aspect ratio. If both are omitted, the input width is used.
        ///
        /// For portrait videos that contain horizontal ASR and rotation metadata,
        /// provide the width, in pixels, per the horizontal ASR. The API calculates
        /// the height per the horizontal ASR. The API detects any rotation metadata
        /// and swaps the requested height and width for the output.
        pub width_pixels: i32,

        /// The height of the video in pixels. Must be an even integer.
        /// When not specified, the height is adjusted to match the specified width
        /// and input aspect ratio. If both are omitted, the input height is used.
        ///
        /// For portrait videos that contain horizontal ASR and rotation metadata,
        /// provide the height, in pixels, per the horizontal ASR. The API calculates
        /// the width per the horizontal ASR. The API detects any rotation metadata
        /// and swaps the requested height and width for the output.
        pub height_pixels: i32,

        /// Required. The target video frame rate in frames per second (FPS). Must be
        /// less than or equal to 120.
        pub frame_rate: f64,

        /// Optional. Frame rate conversion strategy for desired frame rate. The
        /// default is `DOWNSAMPLE`.
        pub frame_rate_conversion_strategy: crate::model::video_stream::FrameRateConversionStrategy,

        /// Required. The video bitrate in bits per second. The minimum value is
        /// 1,000. The maximum value is 800,000,000.
        pub bitrate_bps: i32,

        /// Pixel format to use. The default is `yuv420p`.
        ///
        /// Supported pixel formats:
        ///
        /// - `yuv420p` pixel format
        /// - `yuv422p` pixel format
        /// - `yuv444p` pixel format
        /// - `yuv420p10` 10-bit HDR pixel format
        /// - `yuv422p10` 10-bit HDR pixel format
        /// - `yuv444p10` 10-bit HDR pixel format
        /// - `yuv420p12` 12-bit HDR pixel format
        /// - `yuv422p12` 12-bit HDR pixel format
        /// - `yuv444p12` 12-bit HDR pixel format
        pub pixel_format: std::string::String,

        /// Specify the mode. The default is `vbr`.
        ///
        /// Supported rate control modes:
        ///
        /// - `vbr` - variable bitrate
        /// - `crf` - constant rate factor
        pub rate_control_mode: std::string::String,

        /// Target CRF level. Must be between 10 and 36, where 10 is the highest
        /// quality and 36 is the most efficient compression. The default is 21.
        pub crf_level: i32,

        /// Specifies whether an open Group of Pictures (GOP) structure should be
        /// allowed or not. The default is `false`.
        pub allow_open_gop: bool,

        /// Use two-pass encoding strategy to achieve better video quality.
        /// [H264CodecSettings.rate_control_mode][google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings.rate_control_mode]
        /// must be `vbr`. The default is `false`.
        ///
        /// [google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings.rate_control_mode]: crate::model::video_stream::H264CodecSettings::rate_control_mode
        pub enable_two_pass: bool,

        /// Size of the Video Buffering Verifier (VBV) buffer in bits. Must be
        /// greater than zero. The default is equal to
        /// [H264CodecSettings.bitrate_bps][google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings.bitrate_bps].
        ///
        /// [google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings.bitrate_bps]: crate::model::video_stream::H264CodecSettings::bitrate_bps
        pub vbv_size_bits: i32,

        /// Initial fullness of the Video Buffering Verifier (VBV) buffer in bits.
        /// Must be greater than zero. The default is equal to 90% of
        /// [H264CodecSettings.vbv_size_bits][google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings.vbv_size_bits].
        ///
        /// [google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings.vbv_size_bits]: crate::model::video_stream::H264CodecSettings::vbv_size_bits
        pub vbv_fullness_bits: i32,

        /// The entropy coder to use. The default is `cabac`.
        ///
        /// Supported entropy coders:
        ///
        /// - `cavlc`
        /// - `cabac`
        pub entropy_coder: std::string::String,

        /// Allow B-pyramid for reference frame selection. This may not be supported
        /// on all decoders. The default is `false`.
        pub b_pyramid: bool,

        /// The number of consecutive B-frames. Must be greater than or equal to
        /// zero. Must be less than
        /// [H264CodecSettings.gop_frame_count][google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings.gop_frame_count]
        /// if set. The default is 0.
        ///
        /// [google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings.gop_frame_count]: crate::model::video_stream::H264CodecSettings::gop_mode
        pub b_frame_count: i32,

        /// Specify the intensity of the adaptive quantizer (AQ). Must be between 0
        /// and 1, where 0 disables the quantizer and 1 maximizes the quantizer. A
        /// higher value equals a lower bitrate but smoother image. The default is 0.
        pub aq_strength: f64,

        /// Enforces the specified codec profile. The following profiles are
        /// supported:
        ///
        /// * `baseline`
        /// * `main`
        /// * `high` (default)
        ///
        /// The available options are
        /// [FFmpeg-compatible](https://trac.ffmpeg.org/wiki/Encode/H.264#Tune).
        /// Note that certain values for this field may cause the
        /// transcoder to override other fields you set in the `H264CodecSettings`
        /// message.
        pub profile: std::string::String,

        /// Enforces the specified codec tune. The available options are
        /// [FFmpeg-compatible](https://trac.ffmpeg.org/wiki/Encode/H.264#Tune).
        /// Note that certain values for this field may cause the
        /// transcoder to override other fields you set in the `H264CodecSettings`
        /// message.
        pub tune: std::string::String,

        /// Enforces the specified codec preset. The default is `veryfast`. The
        /// available options are
        /// [FFmpeg-compatible](https://trac.ffmpeg.org/wiki/Encode/H.264#Preset).
        /// Note that certain values for this field may cause the
        /// transcoder to override other fields you set in the `H264CodecSettings`
        /// message.
        pub preset: std::string::String,

        /// GOP mode can be either by frame count or duration.
        pub gop_mode:
            std::option::Option<crate::model::video_stream::h_264_codec_settings::GopMode>,

        /// Color format can be sdr or hlg.
        pub color_format:
            std::option::Option<crate::model::video_stream::h_264_codec_settings::ColorFormat>,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl H264CodecSettings {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [width_pixels][crate::model::video_stream::H264CodecSettings::width_pixels].
        pub fn set_width_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
            self.width_pixels = v.into();
            self
        }

        /// Sets the value of [height_pixels][crate::model::video_stream::H264CodecSettings::height_pixels].
        pub fn set_height_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
            self.height_pixels = v.into();
            self
        }

        /// Sets the value of [frame_rate][crate::model::video_stream::H264CodecSettings::frame_rate].
        pub fn set_frame_rate<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
            self.frame_rate = v.into();
            self
        }

        /// Sets the value of [frame_rate_conversion_strategy][crate::model::video_stream::H264CodecSettings::frame_rate_conversion_strategy].
        pub fn set_frame_rate_conversion_strategy<
            T: std::convert::Into<crate::model::video_stream::FrameRateConversionStrategy>,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.frame_rate_conversion_strategy = v.into();
            self
        }

        /// Sets the value of [bitrate_bps][crate::model::video_stream::H264CodecSettings::bitrate_bps].
        pub fn set_bitrate_bps<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
            self.bitrate_bps = v.into();
            self
        }

        /// Sets the value of [pixel_format][crate::model::video_stream::H264CodecSettings::pixel_format].
        pub fn set_pixel_format<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.pixel_format = v.into();
            self
        }

        /// Sets the value of [rate_control_mode][crate::model::video_stream::H264CodecSettings::rate_control_mode].
        pub fn set_rate_control_mode<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.rate_control_mode = v.into();
            self
        }

        /// Sets the value of [crf_level][crate::model::video_stream::H264CodecSettings::crf_level].
        pub fn set_crf_level<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
            self.crf_level = v.into();
            self
        }

        /// Sets the value of [allow_open_gop][crate::model::video_stream::H264CodecSettings::allow_open_gop].
        pub fn set_allow_open_gop<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
            self.allow_open_gop = v.into();
            self
        }

        /// Sets the value of [enable_two_pass][crate::model::video_stream::H264CodecSettings::enable_two_pass].
        pub fn set_enable_two_pass<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
            self.enable_two_pass = v.into();
            self
        }

        /// Sets the value of [vbv_size_bits][crate::model::video_stream::H264CodecSettings::vbv_size_bits].
        pub fn set_vbv_size_bits<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
            self.vbv_size_bits = v.into();
            self
        }

        /// Sets the value of [vbv_fullness_bits][crate::model::video_stream::H264CodecSettings::vbv_fullness_bits].
        pub fn set_vbv_fullness_bits<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
            self.vbv_fullness_bits = v.into();
            self
        }

        /// Sets the value of [entropy_coder][crate::model::video_stream::H264CodecSettings::entropy_coder].
        pub fn set_entropy_coder<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.entropy_coder = v.into();
            self
        }

        /// Sets the value of [b_pyramid][crate::model::video_stream::H264CodecSettings::b_pyramid].
        pub fn set_b_pyramid<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
            self.b_pyramid = v.into();
            self
        }

        /// Sets the value of [b_frame_count][crate::model::video_stream::H264CodecSettings::b_frame_count].
        pub fn set_b_frame_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
            self.b_frame_count = v.into();
            self
        }

        /// Sets the value of [aq_strength][crate::model::video_stream::H264CodecSettings::aq_strength].
        pub fn set_aq_strength<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
            self.aq_strength = v.into();
            self
        }

        /// Sets the value of [profile][crate::model::video_stream::H264CodecSettings::profile].
        pub fn set_profile<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.profile = v.into();
            self
        }

        /// Sets the value of [tune][crate::model::video_stream::H264CodecSettings::tune].
        pub fn set_tune<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.tune = v.into();
            self
        }

        /// Sets the value of [preset][crate::model::video_stream::H264CodecSettings::preset].
        pub fn set_preset<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.preset = v.into();
            self
        }

        /// Sets the value of [gop_mode][crate::model::video_stream::H264CodecSettings::gop_mode].
        ///
        /// Note that all the setters affecting `gop_mode` are mutually
        /// exclusive.
        pub fn set_gop_mode<
            T: std::convert::Into<
                    std::option::Option<crate::model::video_stream::h_264_codec_settings::GopMode>,
                >,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.gop_mode = v.into();
            self
        }

        /// The value of [gop_mode][crate::model::video_stream::H264CodecSettings::gop_mode]
        /// if it holds a `GopFrameCount`, `None` if the field is not set or
        /// holds a different branch.
        pub fn gop_frame_count(&self) -> std::option::Option<&i32> {
            #[allow(unreachable_patterns)]
            self.gop_mode.as_ref().and_then(|v| match v {
                crate::model::video_stream::h_264_codec_settings::GopMode::GopFrameCount(v) => {
                    std::option::Option::Some(v)
                }
                _ => std::option::Option::None,
            })
        }

        /// Sets the value of [gop_mode][crate::model::video_stream::H264CodecSettings::gop_mode]
        /// to hold a `GopFrameCount`.
        ///
        /// Note that all the setters affecting `gop_mode` are
        /// mutually exclusive.
        pub fn set_gop_frame_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
            self.gop_mode = std::option::Option::Some(
                crate::model::video_stream::h_264_codec_settings::GopMode::GopFrameCount(v.into()),
            );
            self
        }

        /// The value of [gop_mode][crate::model::video_stream::H264CodecSettings::gop_mode]
        /// if it holds a `GopDuration`, `None` if the field is not set or
        /// holds a different branch.
        pub fn gop_duration(&self) -> std::option::Option<&std::boxed::Box<wkt::Duration>> {
            #[allow(unreachable_patterns)]
            self.gop_mode.as_ref().and_then(|v| match v {
                crate::model::video_stream::h_264_codec_settings::GopMode::GopDuration(v) => {
                    std::option::Option::Some(v)
                }
                _ => std::option::Option::None,
            })
        }

        /// Sets the value of [gop_mode][crate::model::video_stream::H264CodecSettings::gop_mode]
        /// to hold a `GopDuration`.
        ///
        /// Note that all the setters affecting `gop_mode` are
        /// mutually exclusive.
        pub fn set_gop_duration<T: std::convert::Into<std::boxed::Box<wkt::Duration>>>(
            mut self,
            v: T,
        ) -> Self {
            self.gop_mode = std::option::Option::Some(
                crate::model::video_stream::h_264_codec_settings::GopMode::GopDuration(v.into()),
            );
            self
        }

        /// Sets the value of [color_format][crate::model::video_stream::H264CodecSettings::color_format].
        ///
        /// Note that all the setters affecting `color_format` are mutually
        /// exclusive.
        pub fn set_color_format<
            T: std::convert::Into<
                    std::option::Option<
                        crate::model::video_stream::h_264_codec_settings::ColorFormat,
                    >,
                >,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.color_format = v.into();
            self
        }

        /// The value of [color_format][crate::model::video_stream::H264CodecSettings::color_format]
        /// if it holds a `Sdr`, `None` if the field is not set or
        /// holds a different branch.
        pub fn sdr(
            &self,
        ) -> std::option::Option<&std::boxed::Box<crate::model::video_stream::H264ColorFormatSDR>>
        {
            #[allow(unreachable_patterns)]
            self.color_format.as_ref().and_then(|v| match v {
                crate::model::video_stream::h_264_codec_settings::ColorFormat::Sdr(v) => {
                    std::option::Option::Some(v)
                }
                _ => std::option::Option::None,
            })
        }

        /// Sets the value of [color_format][crate::model::video_stream::H264CodecSettings::color_format]
        /// to hold a `Sdr`.
        ///
        /// Note that all the setters affecting `color_format` are
        /// mutually exclusive.
        pub fn set_sdr<
            T: std::convert::Into<std::boxed::Box<crate::model::video_stream::H264ColorFormatSDR>>,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.color_format = std::option::Option::Some(
                crate::model::video_stream::h_264_codec_settings::ColorFormat::Sdr(v.into()),
            );
            self
        }

        /// The value of [color_format][crate::model::video_stream::H264CodecSettings::color_format]
        /// if it holds a `Hlg`, `None` if the field is not set or
        /// holds a different branch.
        pub fn hlg(
            &self,
        ) -> std::option::Option<&std::boxed::Box<crate::model::video_stream::H264ColorFormatHLG>>
        {
            #[allow(unreachable_patterns)]
            self.color_format.as_ref().and_then(|v| match v {
                crate::model::video_stream::h_264_codec_settings::ColorFormat::Hlg(v) => {
                    std::option::Option::Some(v)
                }
                _ => std::option::Option::None,
            })
        }

        /// Sets the value of [color_format][crate::model::video_stream::H264CodecSettings::color_format]
        /// to hold a `Hlg`.
        ///
        /// Note that all the setters affecting `color_format` are
        /// mutually exclusive.
        pub fn set_hlg<
            T: std::convert::Into<std::boxed::Box<crate::model::video_stream::H264ColorFormatHLG>>,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.color_format = std::option::Option::Some(
                crate::model::video_stream::h_264_codec_settings::ColorFormat::Hlg(v.into()),
            );
            self
        }
    }

    impl wkt::message::Message for H264CodecSettings {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings"
        }
    }

    /// Defines additional types related to [H264CodecSettings].
    pub mod h_264_codec_settings {
        #[allow(unused_imports)]
        use super::*;

        /// GOP mode can be either by frame count or duration.
        #[derive(Clone, Debug, PartialEq)]
        #[non_exhaustive]
        pub enum GopMode {
            /// Select the GOP size based on the specified frame count. Must be greater
            /// than zero.
            GopFrameCount(i32),
            /// Select the GOP size based on the specified duration. The default is
            /// `3s`. Note that `gopDuration` must be less than or equal to
            /// [`segmentDuration`](#SegmentSettings), and
            /// [`segmentDuration`](#SegmentSettings) must be divisible by
            /// `gopDuration`.
            GopDuration(std::boxed::Box<wkt::Duration>),
        }

        /// Color format can be sdr or hlg.
        #[derive(Clone, Debug, PartialEq)]
        #[non_exhaustive]
        pub enum ColorFormat {
            /// Optional. SDR color format setting for H264.
            Sdr(std::boxed::Box<crate::model::video_stream::H264ColorFormatSDR>),
            /// Optional. HLG color format setting for H264.
            Hlg(std::boxed::Box<crate::model::video_stream::H264ColorFormatHLG>),
        }
    }

    /// Convert the input video to a Standard Dynamic Range (SDR) video.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct H265ColorFormatSDR {
        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl H265ColorFormatSDR {
        pub fn new() -> Self {
            std::default::Default::default()
        }
    }

    impl wkt::message::Message for H265ColorFormatSDR {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream.H265ColorFormatSDR"
        }
    }

    /// Convert the input video to a Hybrid Log Gamma (HLG) video.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct H265ColorFormatHLG {
        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl H265ColorFormatHLG {
        pub fn new() -> Self {
            std::default::Default::default()
        }
    }

    impl wkt::message::Message for H265ColorFormatHLG {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream.H265ColorFormatHLG"
        }
    }

    /// Convert the input video to a High Dynamic Range 10 (HDR10) video.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct H265ColorFormatHDR10 {
        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl H265ColorFormatHDR10 {
        pub fn new() -> Self {
            std::default::Default::default()
        }
    }

    impl wkt::message::Message for H265ColorFormatHDR10 {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream.H265ColorFormatHDR10"
        }
    }

    /// H265 codec settings.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct H265CodecSettings {
        /// The width of the video in pixels. Must be an even integer.
        /// When not specified, the width is adjusted to match the specified height
        /// and input aspect ratio. If both are omitted, the input width is used.
        ///
        /// For portrait videos that contain horizontal ASR and rotation metadata,
        /// provide the width, in pixels, per the horizontal ASR. The API calculates
        /// the height per the horizontal ASR. The API detects any rotation metadata
        /// and swaps the requested height and width for the output.
        pub width_pixels: i32,

        /// The height of the video in pixels. Must be an even integer.
        /// When not specified, the height is adjusted to match the specified width
        /// and input aspect ratio. If both are omitted, the input height is used.
        ///
        /// For portrait videos that contain horizontal ASR and rotation metadata,
        /// provide the height, in pixels, per the horizontal ASR. The API calculates
        /// the width per the horizontal ASR. The API detects any rotation metadata
        /// and swaps the requested height and width for the output.
        pub height_pixels: i32,

        /// Required. The target video frame rate in frames per second (FPS). Must be
        /// less than or equal to 120.
        pub frame_rate: f64,

        /// Optional. Frame rate conversion strategy for desired frame rate. The
        /// default is `DOWNSAMPLE`.
        pub frame_rate_conversion_strategy: crate::model::video_stream::FrameRateConversionStrategy,

        /// Required. The video bitrate in bits per second. The minimum value is
        /// 1,000. The maximum value is 800,000,000.
        pub bitrate_bps: i32,

        /// Pixel format to use. The default is `yuv420p`.
        ///
        /// Supported pixel formats:
        ///
        /// - `yuv420p` pixel format
        /// - `yuv422p` pixel format
        /// - `yuv444p` pixel format
        /// - `yuv420p10` 10-bit HDR pixel format
        /// - `yuv422p10` 10-bit HDR pixel format
        /// - `yuv444p10` 10-bit HDR pixel format
        /// - `yuv420p12` 12-bit HDR pixel format
        /// - `yuv422p12` 12-bit HDR pixel format
        /// - `yuv444p12` 12-bit HDR pixel format
        pub pixel_format: std::string::String,

        /// Specify the mode. The default is `vbr`.
        ///
        /// Supported rate control modes:
        ///
        /// - `vbr` - variable bitrate
        /// - `crf` - constant rate factor
        pub rate_control_mode: std::string::String,

        /// Target CRF level. Must be between 10 and 36, where 10 is the highest
        /// quality and 36 is the most efficient compression. The default is 21.
        pub crf_level: i32,

        /// Specifies whether an open Group of Pictures (GOP) structure should be
        /// allowed or not. The default is `false`.
        pub allow_open_gop: bool,

        /// Use two-pass encoding strategy to achieve better video quality.
        /// [H265CodecSettings.rate_control_mode][google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings.rate_control_mode]
        /// must be `vbr`. The default is `false`.
        ///
        /// [google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings.rate_control_mode]: crate::model::video_stream::H265CodecSettings::rate_control_mode
        pub enable_two_pass: bool,

        /// Size of the Video Buffering Verifier (VBV) buffer in bits. Must be
        /// greater than zero. The default is equal to `VideoStream.bitrate_bps`.
        pub vbv_size_bits: i32,

        /// Initial fullness of the Video Buffering Verifier (VBV) buffer in bits.
        /// Must be greater than zero. The default is equal to 90% of
        /// [H265CodecSettings.vbv_size_bits][google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings.vbv_size_bits].
        ///
        /// [google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings.vbv_size_bits]: crate::model::video_stream::H265CodecSettings::vbv_size_bits
        pub vbv_fullness_bits: i32,

        /// Allow B-pyramid for reference frame selection. This may not be supported
        /// on all decoders. The default is `false`.
        pub b_pyramid: bool,

        /// The number of consecutive B-frames. Must be greater than or equal to
        /// zero. Must be less than
        /// [H265CodecSettings.gop_frame_count][google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings.gop_frame_count]
        /// if set. The default is 0.
        ///
        /// [google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings.gop_frame_count]: crate::model::video_stream::H265CodecSettings::gop_mode
        pub b_frame_count: i32,

        /// Specify the intensity of the adaptive quantizer (AQ). Must be between 0
        /// and 1, where 0 disables the quantizer and 1 maximizes the quantizer. A
        /// higher value equals a lower bitrate but smoother image. The default is 0.
        pub aq_strength: f64,

        /// Enforces the specified codec profile. The following profiles are
        /// supported:
        ///
        /// * 8-bit profiles
        ///   * `main` (default)
        ///   * `main-intra`
        ///   * `mainstillpicture`
        /// * 10-bit profiles
        ///   * `main10` (default)
        ///   * `main10-intra`
        ///   * `main422-10`
        ///   * `main422-10-intra`
        ///   * `main444-10`
        ///   * `main444-10-intra`
        /// * 12-bit profiles
        ///   * `main12` (default)
        ///   * `main12-intra`
        ///   * `main422-12`
        ///   * `main422-12-intra`
        ///   * `main444-12`
        ///   * `main444-12-intra`
        ///
        /// The available options are
        /// [FFmpeg-compatible](https://x265.readthedocs.io/).
        /// Note that certain values for this field may cause the
        /// transcoder to override other fields you set in the `H265CodecSettings`
        /// message.
        pub profile: std::string::String,

        /// Enforces the specified codec tune. The available options are
        /// [FFmpeg-compatible](https://trac.ffmpeg.org/wiki/Encode/H.265).
        /// Note that certain values for this field may cause the
        /// transcoder to override other fields you set in the `H265CodecSettings`
        /// message.
        pub tune: std::string::String,

        /// Enforces the specified codec preset. The default is `veryfast`. The
        /// available options are
        /// [FFmpeg-compatible](https://trac.ffmpeg.org/wiki/Encode/H.265).
        /// Note that certain values for this field may cause the
        /// transcoder to override other fields you set in the `H265CodecSettings`
        /// message.
        pub preset: std::string::String,

        /// GOP mode can be either by frame count or duration.
        pub gop_mode:
            std::option::Option<crate::model::video_stream::h_265_codec_settings::GopMode>,

        /// Color format can be sdr, hlg, hdr10.
        pub color_format:
            std::option::Option<crate::model::video_stream::h_265_codec_settings::ColorFormat>,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl H265CodecSettings {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [width_pixels][crate::model::video_stream::H265CodecSettings::width_pixels].
        pub fn set_width_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
            self.width_pixels = v.into();
            self
        }

        /// Sets the value of [height_pixels][crate::model::video_stream::H265CodecSettings::height_pixels].
        pub fn set_height_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
            self.height_pixels = v.into();
            self
        }

        /// Sets the value of [frame_rate][crate::model::video_stream::H265CodecSettings::frame_rate].
        pub fn set_frame_rate<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
            self.frame_rate = v.into();
            self
        }

        /// Sets the value of [frame_rate_conversion_strategy][crate::model::video_stream::H265CodecSettings::frame_rate_conversion_strategy].
        pub fn set_frame_rate_conversion_strategy<
            T: std::convert::Into<crate::model::video_stream::FrameRateConversionStrategy>,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.frame_rate_conversion_strategy = v.into();
            self
        }

        /// Sets the value of [bitrate_bps][crate::model::video_stream::H265CodecSettings::bitrate_bps].
        pub fn set_bitrate_bps<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
            self.bitrate_bps = v.into();
            self
        }

        /// Sets the value of [pixel_format][crate::model::video_stream::H265CodecSettings::pixel_format].
        pub fn set_pixel_format<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.pixel_format = v.into();
            self
        }

        /// Sets the value of [rate_control_mode][crate::model::video_stream::H265CodecSettings::rate_control_mode].
        pub fn set_rate_control_mode<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.rate_control_mode = v.into();
            self
        }

        /// Sets the value of [crf_level][crate::model::video_stream::H265CodecSettings::crf_level].
        pub fn set_crf_level<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
            self.crf_level = v.into();
            self
        }

        /// Sets the value of [allow_open_gop][crate::model::video_stream::H265CodecSettings::allow_open_gop].
        pub fn set_allow_open_gop<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
            self.allow_open_gop = v.into();
            self
        }

        /// Sets the value of [enable_two_pass][crate::model::video_stream::H265CodecSettings::enable_two_pass].
        pub fn set_enable_two_pass<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
            self.enable_two_pass = v.into();
            self
        }

        /// Sets the value of [vbv_size_bits][crate::model::video_stream::H265CodecSettings::vbv_size_bits].
        pub fn set_vbv_size_bits<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
            self.vbv_size_bits = v.into();
            self
        }

        /// Sets the value of [vbv_fullness_bits][crate::model::video_stream::H265CodecSettings::vbv_fullness_bits].
        pub fn set_vbv_fullness_bits<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
            self.vbv_fullness_bits = v.into();
            self
        }

        /// Sets the value of [b_pyramid][crate::model::video_stream::H265CodecSettings::b_pyramid].
        pub fn set_b_pyramid<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
            self.b_pyramid = v.into();
            self
        }

        /// Sets the value of [b_frame_count][crate::model::video_stream::H265CodecSettings::b_frame_count].
        pub fn set_b_frame_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
            self.b_frame_count = v.into();
            self
        }

        /// Sets the value of [aq_strength][crate::model::video_stream::H265CodecSettings::aq_strength].
        pub fn set_aq_strength<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
            self.aq_strength = v.into();
            self
        }

        /// Sets the value of [profile][crate::model::video_stream::H265CodecSettings::profile].
        pub fn set_profile<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.profile = v.into();
            self
        }

        /// Sets the value of [tune][crate::model::video_stream::H265CodecSettings::tune].
        pub fn set_tune<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.tune = v.into();
            self
        }

        /// Sets the value of [preset][crate::model::video_stream::H265CodecSettings::preset].
        pub fn set_preset<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.preset = v.into();
            self
        }

        /// Sets the value of [gop_mode][crate::model::video_stream::H265CodecSettings::gop_mode].
        ///
        /// Note that all the setters affecting `gop_mode` are mutually
        /// exclusive.
        pub fn set_gop_mode<
            T: std::convert::Into<
                    std::option::Option<crate::model::video_stream::h_265_codec_settings::GopMode>,
                >,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.gop_mode = v.into();
            self
        }

        /// The value of [gop_mode][crate::model::video_stream::H265CodecSettings::gop_mode]
        /// if it holds a `GopFrameCount`, `None` if the field is not set or
        /// holds a different branch.
        pub fn gop_frame_count(&self) -> std::option::Option<&i32> {
            #[allow(unreachable_patterns)]
            self.gop_mode.as_ref().and_then(|v| match v {
                crate::model::video_stream::h_265_codec_settings::GopMode::GopFrameCount(v) => {
                    std::option::Option::Some(v)
                }
                _ => std::option::Option::None,
            })
        }

        /// Sets the value of [gop_mode][crate::model::video_stream::H265CodecSettings::gop_mode]
        /// to hold a `GopFrameCount`.
        ///
        /// Note that all the setters affecting `gop_mode` are
        /// mutually exclusive.
        pub fn set_gop_frame_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
            self.gop_mode = std::option::Option::Some(
                crate::model::video_stream::h_265_codec_settings::GopMode::GopFrameCount(v.into()),
            );
            self
        }

        /// The value of [gop_mode][crate::model::video_stream::H265CodecSettings::gop_mode]
        /// if it holds a `GopDuration`, `None` if the field is not set or
        /// holds a different branch.
        pub fn gop_duration(&self) -> std::option::Option<&std::boxed::Box<wkt::Duration>> {
            #[allow(unreachable_patterns)]
            self.gop_mode.as_ref().and_then(|v| match v {
                crate::model::video_stream::h_265_codec_settings::GopMode::GopDuration(v) => {
                    std::option::Option::Some(v)
                }
                _ => std::option::Option::None,
            })
        }

        /// Sets the value of [gop_mode][crate::model::video_stream::H265CodecSettings::gop_mode]
        /// to hold a `GopDuration`.
        ///
        /// Note that all the setters affecting `gop_mode` are
        /// mutually exclusive.
        pub fn set_gop_duration<T: std::convert::Into<std::boxed::Box<wkt::Duration>>>(
            mut self,
            v: T,
        ) -> Self {
            self.gop_mode = std::option::Option::Some(
                crate::model::video_stream::h_265_codec_settings::GopMode::GopDuration(v.into()),
            );
            self
        }

        /// Sets the value of [color_format][crate::model::video_stream::H265CodecSettings::color_format].
        ///
        /// Note that all the setters affecting `color_format` are mutually
        /// exclusive.
        pub fn set_color_format<
            T: std::convert::Into<
                    std::option::Option<
                        crate::model::video_stream::h_265_codec_settings::ColorFormat,
                    >,
                >,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.color_format = v.into();
            self
        }

        /// The value of [color_format][crate::model::video_stream::H265CodecSettings::color_format]
        /// if it holds a `Sdr`, `None` if the field is not set or
        /// holds a different branch.
        pub fn sdr(
            &self,
        ) -> std::option::Option<&std::boxed::Box<crate::model::video_stream::H265ColorFormatSDR>>
        {
            #[allow(unreachable_patterns)]
            self.color_format.as_ref().and_then(|v| match v {
                crate::model::video_stream::h_265_codec_settings::ColorFormat::Sdr(v) => {
                    std::option::Option::Some(v)
                }
                _ => std::option::Option::None,
            })
        }

        /// Sets the value of [color_format][crate::model::video_stream::H265CodecSettings::color_format]
        /// to hold a `Sdr`.
        ///
        /// Note that all the setters affecting `color_format` are
        /// mutually exclusive.
        pub fn set_sdr<
            T: std::convert::Into<std::boxed::Box<crate::model::video_stream::H265ColorFormatSDR>>,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.color_format = std::option::Option::Some(
                crate::model::video_stream::h_265_codec_settings::ColorFormat::Sdr(v.into()),
            );
            self
        }

        /// The value of [color_format][crate::model::video_stream::H265CodecSettings::color_format]
        /// if it holds a `Hlg`, `None` if the field is not set or
        /// holds a different branch.
        pub fn hlg(
            &self,
        ) -> std::option::Option<&std::boxed::Box<crate::model::video_stream::H265ColorFormatHLG>>
        {
            #[allow(unreachable_patterns)]
            self.color_format.as_ref().and_then(|v| match v {
                crate::model::video_stream::h_265_codec_settings::ColorFormat::Hlg(v) => {
                    std::option::Option::Some(v)
                }
                _ => std::option::Option::None,
            })
        }

        /// Sets the value of [color_format][crate::model::video_stream::H265CodecSettings::color_format]
        /// to hold a `Hlg`.
        ///
        /// Note that all the setters affecting `color_format` are
        /// mutually exclusive.
        pub fn set_hlg<
            T: std::convert::Into<std::boxed::Box<crate::model::video_stream::H265ColorFormatHLG>>,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.color_format = std::option::Option::Some(
                crate::model::video_stream::h_265_codec_settings::ColorFormat::Hlg(v.into()),
            );
            self
        }

        /// The value of [color_format][crate::model::video_stream::H265CodecSettings::color_format]
        /// if it holds a `Hdr10`, `None` if the field is not set or
        /// holds a different branch.
        pub fn hdr10(
            &self,
        ) -> std::option::Option<&std::boxed::Box<crate::model::video_stream::H265ColorFormatHDR10>>
        {
            #[allow(unreachable_patterns)]
            self.color_format.as_ref().and_then(|v| match v {
                crate::model::video_stream::h_265_codec_settings::ColorFormat::Hdr10(v) => {
                    std::option::Option::Some(v)
                }
                _ => std::option::Option::None,
            })
        }

        /// Sets the value of [color_format][crate::model::video_stream::H265CodecSettings::color_format]
        /// to hold a `Hdr10`.
        ///
        /// Note that all the setters affecting `color_format` are
        /// mutually exclusive.
        pub fn set_hdr10<
            T: std::convert::Into<std::boxed::Box<crate::model::video_stream::H265ColorFormatHDR10>>,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.color_format = std::option::Option::Some(
                crate::model::video_stream::h_265_codec_settings::ColorFormat::Hdr10(v.into()),
            );
            self
        }
    }

    impl wkt::message::Message for H265CodecSettings {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings"
        }
    }

    /// Defines additional types related to [H265CodecSettings].
    pub mod h_265_codec_settings {
        #[allow(unused_imports)]
        use super::*;

        /// GOP mode can be either by frame count or duration.
        #[derive(Clone, Debug, PartialEq)]
        #[non_exhaustive]
        pub enum GopMode {
            /// Select the GOP size based on the specified frame count. Must be greater
            /// than zero.
            GopFrameCount(i32),
            /// Select the GOP size based on the specified duration. The default is
            /// `3s`. Note that `gopDuration` must be less than or equal to
            /// [`segmentDuration`](#SegmentSettings), and
            /// [`segmentDuration`](#SegmentSettings) must be divisible by
            /// `gopDuration`.
            GopDuration(std::boxed::Box<wkt::Duration>),
        }

        /// Color format can be sdr, hlg, hdr10.
        #[derive(Clone, Debug, PartialEq)]
        #[non_exhaustive]
        pub enum ColorFormat {
            /// Optional. SDR color format setting for H265.
            Sdr(std::boxed::Box<crate::model::video_stream::H265ColorFormatSDR>),
            /// Optional. HLG color format setting for H265.
            Hlg(std::boxed::Box<crate::model::video_stream::H265ColorFormatHLG>),
            /// Optional. HDR10 color format setting for H265.
            Hdr10(std::boxed::Box<crate::model::video_stream::H265ColorFormatHDR10>),
        }
    }

    /// Convert the input video to a Standard Dynamic Range (SDR) video.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct Vp9ColorFormatSDR {
        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl Vp9ColorFormatSDR {
        pub fn new() -> Self {
            std::default::Default::default()
        }
    }

    impl wkt::message::Message for Vp9ColorFormatSDR {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream.Vp9ColorFormatSDR"
        }
    }

    /// Convert the input video to a Hybrid Log Gamma (HLG) video.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct Vp9ColorFormatHLG {
        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl Vp9ColorFormatHLG {
        pub fn new() -> Self {
            std::default::Default::default()
        }
    }

    impl wkt::message::Message for Vp9ColorFormatHLG {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream.Vp9ColorFormatHLG"
        }
    }

    /// VP9 codec settings.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct Vp9CodecSettings {
        /// The width of the video in pixels. Must be an even integer.
        /// When not specified, the width is adjusted to match the specified height
        /// and input aspect ratio. If both are omitted, the input width is used.
        ///
        /// For portrait videos that contain horizontal ASR and rotation metadata,
        /// provide the width, in pixels, per the horizontal ASR. The API calculates
        /// the height per the horizontal ASR. The API detects any rotation metadata
        /// and swaps the requested height and width for the output.
        pub width_pixels: i32,

        /// The height of the video in pixels. Must be an even integer.
        /// When not specified, the height is adjusted to match the specified width
        /// and input aspect ratio. If both are omitted, the input height is used.
        ///
        /// For portrait videos that contain horizontal ASR and rotation metadata,
        /// provide the height, in pixels, per the horizontal ASR. The API calculates
        /// the width per the horizontal ASR. The API detects any rotation metadata
        /// and swaps the requested height and width for the output.
        pub height_pixels: i32,

        /// Required. The target video frame rate in frames per second (FPS). Must be
        /// less than or equal to 120.
        pub frame_rate: f64,

        /// Optional. Frame rate conversion strategy for desired frame rate. The
        /// default is `DOWNSAMPLE`.
        pub frame_rate_conversion_strategy: crate::model::video_stream::FrameRateConversionStrategy,

        /// Required. The video bitrate in bits per second. The minimum value is
        /// 1,000. The maximum value is 480,000,000.
        pub bitrate_bps: i32,

        /// Pixel format to use. The default is `yuv420p`.
        ///
        /// Supported pixel formats:
        ///
        /// - `yuv420p` pixel format
        /// - `yuv422p` pixel format
        /// - `yuv444p` pixel format
        /// - `yuv420p10` 10-bit HDR pixel format
        /// - `yuv422p10` 10-bit HDR pixel format
        /// - `yuv444p10` 10-bit HDR pixel format
        /// - `yuv420p12` 12-bit HDR pixel format
        /// - `yuv422p12` 12-bit HDR pixel format
        /// - `yuv444p12` 12-bit HDR pixel format
        pub pixel_format: std::string::String,

        /// Specify the mode. The default is `vbr`.
        ///
        /// Supported rate control modes:
        ///
        /// - `vbr` - variable bitrate
        pub rate_control_mode: std::string::String,

        /// Target CRF level. Must be between 10 and 36, where 10 is the highest
        /// quality and 36 is the most efficient compression. The default is 21.
        ///
        /// **Note:** This field is not supported.
        pub crf_level: i32,

        /// Enforces the specified codec profile. The following profiles are
        /// supported:
        ///
        /// * `profile0` (default)
        /// * `profile1`
        /// * `profile2`
        /// * `profile3`
        ///
        /// The available options are
        /// [WebM-compatible](https://www.webmproject.org/vp9/profiles/).
        /// Note that certain values for this field may cause the
        /// transcoder to override other fields you set in the `Vp9CodecSettings`
        /// message.
        pub profile: std::string::String,

        /// GOP mode can be either by frame count or duration.
        pub gop_mode: std::option::Option<crate::model::video_stream::vp_9_codec_settings::GopMode>,

        /// Color format can be sdr or hlg.
        pub color_format:
            std::option::Option<crate::model::video_stream::vp_9_codec_settings::ColorFormat>,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl Vp9CodecSettings {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [width_pixels][crate::model::video_stream::Vp9CodecSettings::width_pixels].
        pub fn set_width_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
            self.width_pixels = v.into();
            self
        }

        /// Sets the value of [height_pixels][crate::model::video_stream::Vp9CodecSettings::height_pixels].
        pub fn set_height_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
            self.height_pixels = v.into();
            self
        }

        /// Sets the value of [frame_rate][crate::model::video_stream::Vp9CodecSettings::frame_rate].
        pub fn set_frame_rate<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
            self.frame_rate = v.into();
            self
        }

        /// Sets the value of [frame_rate_conversion_strategy][crate::model::video_stream::Vp9CodecSettings::frame_rate_conversion_strategy].
        pub fn set_frame_rate_conversion_strategy<
            T: std::convert::Into<crate::model::video_stream::FrameRateConversionStrategy>,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.frame_rate_conversion_strategy = v.into();
            self
        }

        /// Sets the value of [bitrate_bps][crate::model::video_stream::Vp9CodecSettings::bitrate_bps].
        pub fn set_bitrate_bps<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
            self.bitrate_bps = v.into();
            self
        }

        /// Sets the value of [pixel_format][crate::model::video_stream::Vp9CodecSettings::pixel_format].
        pub fn set_pixel_format<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.pixel_format = v.into();
            self
        }

        /// Sets the value of [rate_control_mode][crate::model::video_stream::Vp9CodecSettings::rate_control_mode].
        pub fn set_rate_control_mode<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.rate_control_mode = v.into();
            self
        }

        /// Sets the value of [crf_level][crate::model::video_stream::Vp9CodecSettings::crf_level].
        pub fn set_crf_level<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
            self.crf_level = v.into();
            self
        }

        /// Sets the value of [profile][crate::model::video_stream::Vp9CodecSettings::profile].
        pub fn set_profile<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.profile = v.into();
            self
        }

        /// Sets the value of [gop_mode][crate::model::video_stream::Vp9CodecSettings::gop_mode].
        ///
        /// Note that all the setters affecting `gop_mode` are mutually
        /// exclusive.
        pub fn set_gop_mode<
            T: std::convert::Into<
                    std::option::Option<crate::model::video_stream::vp_9_codec_settings::GopMode>,
                >,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.gop_mode = v.into();
            self
        }

        /// The value of [gop_mode][crate::model::video_stream::Vp9CodecSettings::gop_mode]
        /// if it holds a `GopFrameCount`, `None` if the field is not set or
        /// holds a different branch.
        pub fn gop_frame_count(&self) -> std::option::Option<&i32> {
            #[allow(unreachable_patterns)]
            self.gop_mode.as_ref().and_then(|v| match v {
                crate::model::video_stream::vp_9_codec_settings::GopMode::GopFrameCount(v) => {
                    std::option::Option::Some(v)
                }
                _ => std::option::Option::None,
            })
        }

        /// Sets the value of [gop_mode][crate::model::video_stream::Vp9CodecSettings::gop_mode]
        /// to hold a `GopFrameCount`.
        ///
        /// Note that all the setters affecting `gop_mode` are
        /// mutually exclusive.
        pub fn set_gop_frame_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
            self.gop_mode = std::option::Option::Some(
                crate::model::video_stream::vp_9_codec_settings::GopMode::GopFrameCount(v.into()),
            );
            self
        }

        /// The value of [gop_mode][crate::model::video_stream::Vp9CodecSettings::gop_mode]
        /// if it holds a `GopDuration`, `None` if the field is not set or
        /// holds a different branch.
        pub fn gop_duration(&self) -> std::option::Option<&std::boxed::Box<wkt::Duration>> {
            #[allow(unreachable_patterns)]
            self.gop_mode.as_ref().and_then(|v| match v {
                crate::model::video_stream::vp_9_codec_settings::GopMode::GopDuration(v) => {
                    std::option::Option::Some(v)
                }
                _ => std::option::Option::None,
            })
        }

        /// Sets the value of [gop_mode][crate::model::video_stream::Vp9CodecSettings::gop_mode]
        /// to hold a `GopDuration`.
        ///
        /// Note that all the setters affecting `gop_mode` are
        /// mutually exclusive.
        pub fn set_gop_duration<T: std::convert::Into<std::boxed::Box<wkt::Duration>>>(
            mut self,
            v: T,
        ) -> Self {
            self.gop_mode = std::option::Option::Some(
                crate::model::video_stream::vp_9_codec_settings::GopMode::GopDuration(v.into()),
            );
            self
        }

        /// Sets the value of [color_format][crate::model::video_stream::Vp9CodecSettings::color_format].
        ///
        /// Note that all the setters affecting `color_format` are mutually
        /// exclusive.
        pub fn set_color_format<
            T: std::convert::Into<
                    std::option::Option<
                        crate::model::video_stream::vp_9_codec_settings::ColorFormat,
                    >,
                >,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.color_format = v.into();
            self
        }

        /// The value of [color_format][crate::model::video_stream::Vp9CodecSettings::color_format]
        /// if it holds a `Sdr`, `None` if the field is not set or
        /// holds a different branch.
        pub fn sdr(
            &self,
        ) -> std::option::Option<&std::boxed::Box<crate::model::video_stream::Vp9ColorFormatSDR>>
        {
            #[allow(unreachable_patterns)]
            self.color_format.as_ref().and_then(|v| match v {
                crate::model::video_stream::vp_9_codec_settings::ColorFormat::Sdr(v) => {
                    std::option::Option::Some(v)
                }
                _ => std::option::Option::None,
            })
        }

        /// Sets the value of [color_format][crate::model::video_stream::Vp9CodecSettings::color_format]
        /// to hold a `Sdr`.
        ///
        /// Note that all the setters affecting `color_format` are
        /// mutually exclusive.
        pub fn set_sdr<
            T: std::convert::Into<std::boxed::Box<crate::model::video_stream::Vp9ColorFormatSDR>>,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.color_format = std::option::Option::Some(
                crate::model::video_stream::vp_9_codec_settings::ColorFormat::Sdr(v.into()),
            );
            self
        }

        /// The value of [color_format][crate::model::video_stream::Vp9CodecSettings::color_format]
        /// if it holds a `Hlg`, `None` if the field is not set or
        /// holds a different branch.
        pub fn hlg(
            &self,
        ) -> std::option::Option<&std::boxed::Box<crate::model::video_stream::Vp9ColorFormatHLG>>
        {
            #[allow(unreachable_patterns)]
            self.color_format.as_ref().and_then(|v| match v {
                crate::model::video_stream::vp_9_codec_settings::ColorFormat::Hlg(v) => {
                    std::option::Option::Some(v)
                }
                _ => std::option::Option::None,
            })
        }

        /// Sets the value of [color_format][crate::model::video_stream::Vp9CodecSettings::color_format]
        /// to hold a `Hlg`.
        ///
        /// Note that all the setters affecting `color_format` are
        /// mutually exclusive.
        pub fn set_hlg<
            T: std::convert::Into<std::boxed::Box<crate::model::video_stream::Vp9ColorFormatHLG>>,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.color_format = std::option::Option::Some(
                crate::model::video_stream::vp_9_codec_settings::ColorFormat::Hlg(v.into()),
            );
            self
        }
    }

    impl wkt::message::Message for Vp9CodecSettings {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream.Vp9CodecSettings"
        }
    }

    /// Defines additional types related to [Vp9CodecSettings].
    pub mod vp_9_codec_settings {
        #[allow(unused_imports)]
        use super::*;

        /// GOP mode can be either by frame count or duration.
        #[derive(Clone, Debug, PartialEq)]
        #[non_exhaustive]
        pub enum GopMode {
            /// Select the GOP size based on the specified frame count. Must be greater
            /// than zero.
            GopFrameCount(i32),
            /// Select the GOP size based on the specified duration. The default is
            /// `3s`. Note that `gopDuration` must be less than or equal to
            /// [`segmentDuration`](#SegmentSettings), and
            /// [`segmentDuration`](#SegmentSettings) must be divisible by
            /// `gopDuration`.
            GopDuration(std::boxed::Box<wkt::Duration>),
        }

        /// Color format can be sdr or hlg.
        #[derive(Clone, Debug, PartialEq)]
        #[non_exhaustive]
        pub enum ColorFormat {
            /// Optional. SDR color format setting for VP9.
            Sdr(std::boxed::Box<crate::model::video_stream::Vp9ColorFormatSDR>),
            /// Optional. HLG color format setting for VP9.
            Hlg(std::boxed::Box<crate::model::video_stream::Vp9ColorFormatHLG>),
        }
    }

    /// The conversion strategy for desired frame rate.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum FrameRateConversionStrategy {
        /// Unspecified frame rate conversion strategy.
        Unspecified,
        /// Selectively retain frames to reduce the output frame rate.
        /// Every _n_ th frame is kept, where `n = ceil(input frame rate / target
        /// frame rate)`. When _n_ = 1 (that is, the target frame rate is greater
        /// than the input frame rate), the output frame rate matches the input frame
        /// rate. When _n_ > 1, frames are dropped and the output frame rate is
        /// equal to `(input frame rate / n)`. For more information, see
        /// [Calculate frame
        /// rate](https://cloud.google.com/transcoder/docs/concepts/frame-rate).
        Downsample,
        /// Drop or duplicate frames to match the specified frame rate.
        DropDuplicate,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [FrameRateConversionStrategy::value] or
        /// [FrameRateConversionStrategy::name].
        UnknownValue(frame_rate_conversion_strategy::UnknownValue),
    }

    #[doc(hidden)]
    pub mod frame_rate_conversion_strategy {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl FrameRateConversionStrategy {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Downsample => std::option::Option::Some(1),
                Self::DropDuplicate => std::option::Option::Some(2),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => {
                    std::option::Option::Some("FRAME_RATE_CONVERSION_STRATEGY_UNSPECIFIED")
                }
                Self::Downsample => std::option::Option::Some("DOWNSAMPLE"),
                Self::DropDuplicate => std::option::Option::Some("DROP_DUPLICATE"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for FrameRateConversionStrategy {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for FrameRateConversionStrategy {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for FrameRateConversionStrategy {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Downsample,
                2 => Self::DropDuplicate,
                _ => Self::UnknownValue(frame_rate_conversion_strategy::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for FrameRateConversionStrategy {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "FRAME_RATE_CONVERSION_STRATEGY_UNSPECIFIED" => Self::Unspecified,
                "DOWNSAMPLE" => Self::Downsample,
                "DROP_DUPLICATE" => Self::DropDuplicate,
                _ => Self::UnknownValue(frame_rate_conversion_strategy::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for FrameRateConversionStrategy {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Downsample => serializer.serialize_i32(1),
                Self::DropDuplicate => serializer.serialize_i32(2),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for FrameRateConversionStrategy {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(
                wkt::internal::EnumVisitor::<FrameRateConversionStrategy>::new(
                    ".google.cloud.video.transcoder.v1.VideoStream.FrameRateConversionStrategy",
                ),
            )
        }
    }

    /// Codec settings can be h264, h265, or vp9.
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum CodecSettings {
        /// H264 codec settings.
        H264(std::boxed::Box<crate::model::video_stream::H264CodecSettings>),
        /// H265 codec settings.
        H265(std::boxed::Box<crate::model::video_stream::H265CodecSettings>),
        /// VP9 codec settings.
        Vp9(std::boxed::Box<crate::model::video_stream::Vp9CodecSettings>),
    }
}

/// Audio stream resource.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AudioStream {
    /// The codec for this audio stream. The default is `aac`.
    ///
    /// Supported audio codecs:
    ///
    /// - `aac`
    /// - `aac-he`
    /// - `aac-he-v2`
    /// - `mp3`
    /// - `ac3`
    /// - `eac3`
    /// - `vorbis`
    pub codec: std::string::String,

    /// Required. Audio bitrate in bits per second. Must be between 1 and
    /// 10,000,000.
    pub bitrate_bps: i32,

    /// Number of audio channels. Must be between 1 and 6. The default is 2.
    pub channel_count: i32,

    /// A list of channel names specifying layout of the audio channels.
    /// This only affects the metadata embedded in the container headers, if
    /// supported by the specified format. The default is `["fl", "fr"]`.
    ///
    /// Supported channel names:
    ///
    /// - `fl` - Front left channel
    /// - `fr` - Front right channel
    /// - `sl` - Side left channel
    /// - `sr` - Side right channel
    /// - `fc` - Front center channel
    /// - `lfe` - Low frequency
    pub channel_layout: std::vec::Vec<std::string::String>,

    /// The mapping for the
    /// [JobConfig.edit_list][google.cloud.video.transcoder.v1.JobConfig.edit_list]
    /// atoms with audio
    /// [EditAtom.inputs][google.cloud.video.transcoder.v1.EditAtom.inputs].
    ///
    /// [google.cloud.video.transcoder.v1.EditAtom.inputs]: crate::model::EditAtom::inputs
    /// [google.cloud.video.transcoder.v1.JobConfig.edit_list]: crate::model::JobConfig::edit_list
    pub mapping: std::vec::Vec<crate::model::audio_stream::AudioMapping>,

    /// The audio sample rate in Hertz. The default is 48000 Hertz.
    pub sample_rate_hertz: i32,

    /// The BCP-47 language code, such as `en-US` or `sr-Latn`. For more
    /// information, see
    /// <https://www.unicode.org/reports/tr35/#Unicode_locale_identifier>. Not
    /// supported in MP4 files.
    pub language_code: std::string::String,

    /// The name for this particular audio stream that
    /// will be added to the HLS/DASH manifest. Not supported in MP4 files.
    pub display_name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl AudioStream {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [codec][crate::model::AudioStream::codec].
    pub fn set_codec<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.codec = v.into();
        self
    }

    /// Sets the value of [bitrate_bps][crate::model::AudioStream::bitrate_bps].
    pub fn set_bitrate_bps<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.bitrate_bps = v.into();
        self
    }

    /// Sets the value of [channel_count][crate::model::AudioStream::channel_count].
    pub fn set_channel_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.channel_count = v.into();
        self
    }

    /// Sets the value of [channel_layout][crate::model::AudioStream::channel_layout].
    pub fn set_channel_layout<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.channel_layout = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [mapping][crate::model::AudioStream::mapping].
    pub fn set_mapping<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::audio_stream::AudioMapping>,
    {
        use std::iter::Iterator;
        self.mapping = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [sample_rate_hertz][crate::model::AudioStream::sample_rate_hertz].
    pub fn set_sample_rate_hertz<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.sample_rate_hertz = v.into();
        self
    }

    /// Sets the value of [language_code][crate::model::AudioStream::language_code].
    pub fn set_language_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.language_code = v.into();
        self
    }

    /// Sets the value of [display_name][crate::model::AudioStream::display_name].
    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.display_name = v.into();
        self
    }
}

impl wkt::message::Message for AudioStream {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.transcoder.v1.AudioStream"
    }
}

/// Defines additional types related to [AudioStream].
pub mod audio_stream {
    #[allow(unused_imports)]
    use super::*;

    /// The mapping for the
    /// [JobConfig.edit_list][google.cloud.video.transcoder.v1.JobConfig.edit_list]
    /// atoms with audio
    /// [EditAtom.inputs][google.cloud.video.transcoder.v1.EditAtom.inputs].
    ///
    /// [google.cloud.video.transcoder.v1.EditAtom.inputs]: crate::model::EditAtom::inputs
    /// [google.cloud.video.transcoder.v1.JobConfig.edit_list]: crate::model::JobConfig::edit_list
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct AudioMapping {
        /// Required. The
        /// [EditAtom.key][google.cloud.video.transcoder.v1.EditAtom.key] that
        /// references the atom with audio inputs in the
        /// [JobConfig.edit_list][google.cloud.video.transcoder.v1.JobConfig.edit_list].
        ///
        /// [google.cloud.video.transcoder.v1.EditAtom.key]: crate::model::EditAtom::key
        /// [google.cloud.video.transcoder.v1.JobConfig.edit_list]: crate::model::JobConfig::edit_list
        pub atom_key: std::string::String,

        /// Required. The [Input.key][google.cloud.video.transcoder.v1.Input.key]
        /// that identifies the input file.
        ///
        /// [google.cloud.video.transcoder.v1.Input.key]: crate::model::Input::key
        pub input_key: std::string::String,

        /// Required. The zero-based index of the track in the input file.
        pub input_track: i32,

        /// Required. The zero-based index of the channel in the input audio stream.
        pub input_channel: i32,

        /// Required. The zero-based index of the channel in the output audio stream.
        pub output_channel: i32,

        /// Audio volume control in dB. Negative values decrease volume,
        /// positive values increase. The default is 0.
        pub gain_db: f64,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl AudioMapping {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [atom_key][crate::model::audio_stream::AudioMapping::atom_key].
        pub fn set_atom_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.atom_key = v.into();
            self
        }

        /// Sets the value of [input_key][crate::model::audio_stream::AudioMapping::input_key].
        pub fn set_input_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.input_key = v.into();
            self
        }

        /// Sets the value of [input_track][crate::model::audio_stream::AudioMapping::input_track].
        pub fn set_input_track<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
            self.input_track = v.into();
            self
        }

        /// Sets the value of [input_channel][crate::model::audio_stream::AudioMapping::input_channel].
        pub fn set_input_channel<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
            self.input_channel = v.into();
            self
        }

        /// Sets the value of [output_channel][crate::model::audio_stream::AudioMapping::output_channel].
        pub fn set_output_channel<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
            self.output_channel = v.into();
            self
        }

        /// Sets the value of [gain_db][crate::model::audio_stream::AudioMapping::gain_db].
        pub fn set_gain_db<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
            self.gain_db = v.into();
            self
        }
    }

    impl wkt::message::Message for AudioMapping {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.video.transcoder.v1.AudioStream.AudioMapping"
        }
    }
}

/// Encoding of a text stream. For example, closed captions or subtitles.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TextStream {
    /// The codec for this text stream. The default is `webvtt`.
    ///
    /// Supported text codecs:
    ///
    /// - `srt`
    /// - `ttml`
    /// - `cea608`
    /// - `cea708`
    /// - `webvtt`
    pub codec: std::string::String,

    /// The BCP-47 language code, such as `en-US` or `sr-Latn`. For more
    /// information, see
    /// <https://www.unicode.org/reports/tr35/#Unicode_locale_identifier>. Not
    /// supported in MP4 files.
    pub language_code: std::string::String,

    /// The mapping for the
    /// [JobConfig.edit_list][google.cloud.video.transcoder.v1.JobConfig.edit_list]
    /// atoms with text
    /// [EditAtom.inputs][google.cloud.video.transcoder.v1.EditAtom.inputs].
    ///
    /// [google.cloud.video.transcoder.v1.EditAtom.inputs]: crate::model::EditAtom::inputs
    /// [google.cloud.video.transcoder.v1.JobConfig.edit_list]: crate::model::JobConfig::edit_list
    pub mapping: std::vec::Vec<crate::model::text_stream::TextMapping>,

    /// The name for this particular text stream that
    /// will be added to the HLS/DASH manifest. Not supported in MP4 files.
    pub display_name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl TextStream {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [codec][crate::model::TextStream::codec].
    pub fn set_codec<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.codec = v.into();
        self
    }

    /// Sets the value of [language_code][crate::model::TextStream::language_code].
    pub fn set_language_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.language_code = v.into();
        self
    }

    /// Sets the value of [mapping][crate::model::TextStream::mapping].
    pub fn set_mapping<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::text_stream::TextMapping>,
    {
        use std::iter::Iterator;
        self.mapping = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [display_name][crate::model::TextStream::display_name].
    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.display_name = v.into();
        self
    }
}

impl wkt::message::Message for TextStream {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.transcoder.v1.TextStream"
    }
}

/// Defines additional types related to [TextStream].
pub mod text_stream {
    #[allow(unused_imports)]
    use super::*;

    /// The mapping for the
    /// [JobConfig.edit_list][google.cloud.video.transcoder.v1.JobConfig.edit_list]
    /// atoms with text
    /// [EditAtom.inputs][google.cloud.video.transcoder.v1.EditAtom.inputs].
    ///
    /// [google.cloud.video.transcoder.v1.EditAtom.inputs]: crate::model::EditAtom::inputs
    /// [google.cloud.video.transcoder.v1.JobConfig.edit_list]: crate::model::JobConfig::edit_list
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct TextMapping {
        /// Required. The
        /// [EditAtom.key][google.cloud.video.transcoder.v1.EditAtom.key] that
        /// references atom with text inputs in the
        /// [JobConfig.edit_list][google.cloud.video.transcoder.v1.JobConfig.edit_list].
        ///
        /// [google.cloud.video.transcoder.v1.EditAtom.key]: crate::model::EditAtom::key
        /// [google.cloud.video.transcoder.v1.JobConfig.edit_list]: crate::model::JobConfig::edit_list
        pub atom_key: std::string::String,

        /// Required. The [Input.key][google.cloud.video.transcoder.v1.Input.key]
        /// that identifies the input file.
        ///
        /// [google.cloud.video.transcoder.v1.Input.key]: crate::model::Input::key
        pub input_key: std::string::String,

        /// Required. The zero-based index of the track in the input file.
        pub input_track: i32,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl TextMapping {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [atom_key][crate::model::text_stream::TextMapping::atom_key].
        pub fn set_atom_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.atom_key = v.into();
            self
        }

        /// Sets the value of [input_key][crate::model::text_stream::TextMapping::input_key].
        pub fn set_input_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.input_key = v.into();
            self
        }

        /// Sets the value of [input_track][crate::model::text_stream::TextMapping::input_track].
        pub fn set_input_track<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
            self.input_track = v.into();
            self
        }
    }

    impl wkt::message::Message for TextMapping {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.video.transcoder.v1.TextStream.TextMapping"
        }
    }
}

/// Segment settings for `ts`, `fmp4` and `vtt`.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SegmentSettings {
    /// Duration of the segments in seconds. The default is `6.0s`. Note that
    /// `segmentDuration` must be greater than or equal to
    /// [`gopDuration`](#videostream), and `segmentDuration` must be divisible by
    /// [`gopDuration`](#videostream).
    pub segment_duration: std::option::Option<wkt::Duration>,

    /// Required. Create an individual segment file. The default is `false`.
    pub individual_segments: bool,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl SegmentSettings {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [segment_duration][crate::model::SegmentSettings::segment_duration].
    pub fn set_segment_duration<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Duration>,
    {
        self.segment_duration = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [segment_duration][crate::model::SegmentSettings::segment_duration].
    pub fn set_or_clear_segment_duration<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Duration>,
    {
        self.segment_duration = v.map(|x| x.into());
        self
    }

    /// Sets the value of [individual_segments][crate::model::SegmentSettings::individual_segments].
    pub fn set_individual_segments<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.individual_segments = v.into();
        self
    }
}

impl wkt::message::Message for SegmentSettings {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.transcoder.v1.SegmentSettings"
    }
}

/// Encryption settings.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Encryption {
    /// Required. Identifier for this set of encryption options.
    pub id: std::string::String,

    /// Required. DRM system(s) to use; at least one must be specified. If a
    /// DRM system is omitted, it is considered disabled.
    pub drm_systems: std::option::Option<crate::model::encryption::DrmSystems>,

    /// Encryption mode can be either `aes` or `cenc`.
    pub encryption_mode: std::option::Option<crate::model::encryption::EncryptionMode>,

    /// Defines where content keys are stored.
    pub secret_source: std::option::Option<crate::model::encryption::SecretSource>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Encryption {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [id][crate::model::Encryption::id].
    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.id = v.into();
        self
    }

    /// Sets the value of [drm_systems][crate::model::Encryption::drm_systems].
    pub fn set_drm_systems<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::encryption::DrmSystems>,
    {
        self.drm_systems = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [drm_systems][crate::model::Encryption::drm_systems].
    pub fn set_or_clear_drm_systems<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::encryption::DrmSystems>,
    {
        self.drm_systems = v.map(|x| x.into());
        self
    }

    /// Sets the value of [encryption_mode][crate::model::Encryption::encryption_mode].
    ///
    /// Note that all the setters affecting `encryption_mode` are mutually
    /// exclusive.
    pub fn set_encryption_mode<
        T: std::convert::Into<std::option::Option<crate::model::encryption::EncryptionMode>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.encryption_mode = v.into();
        self
    }

    /// The value of [encryption_mode][crate::model::Encryption::encryption_mode]
    /// if it holds a `Aes128`, `None` if the field is not set or
    /// holds a different branch.
    pub fn aes_128(
        &self,
    ) -> std::option::Option<&std::boxed::Box<crate::model::encryption::Aes128Encryption>> {
        #[allow(unreachable_patterns)]
        self.encryption_mode.as_ref().and_then(|v| match v {
            crate::model::encryption::EncryptionMode::Aes128(v) => std::option::Option::Some(v),
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [encryption_mode][crate::model::Encryption::encryption_mode]
    /// to hold a `Aes128`.
    ///
    /// Note that all the setters affecting `encryption_mode` are
    /// mutually exclusive.
    pub fn set_aes_128<
        T: std::convert::Into<std::boxed::Box<crate::model::encryption::Aes128Encryption>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.encryption_mode =
            std::option::Option::Some(crate::model::encryption::EncryptionMode::Aes128(v.into()));
        self
    }

    /// The value of [encryption_mode][crate::model::Encryption::encryption_mode]
    /// if it holds a `SampleAes`, `None` if the field is not set or
    /// holds a different branch.
    pub fn sample_aes(
        &self,
    ) -> std::option::Option<&std::boxed::Box<crate::model::encryption::SampleAesEncryption>> {
        #[allow(unreachable_patterns)]
        self.encryption_mode.as_ref().and_then(|v| match v {
            crate::model::encryption::EncryptionMode::SampleAes(v) => std::option::Option::Some(v),
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [encryption_mode][crate::model::Encryption::encryption_mode]
    /// to hold a `SampleAes`.
    ///
    /// Note that all the setters affecting `encryption_mode` are
    /// mutually exclusive.
    pub fn set_sample_aes<
        T: std::convert::Into<std::boxed::Box<crate::model::encryption::SampleAesEncryption>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.encryption_mode = std::option::Option::Some(
            crate::model::encryption::EncryptionMode::SampleAes(v.into()),
        );
        self
    }

    /// The value of [encryption_mode][crate::model::Encryption::encryption_mode]
    /// if it holds a `MpegCenc`, `None` if the field is not set or
    /// holds a different branch.
    pub fn mpeg_cenc(
        &self,
    ) -> std::option::Option<&std::boxed::Box<crate::model::encryption::MpegCommonEncryption>> {
        #[allow(unreachable_patterns)]
        self.encryption_mode.as_ref().and_then(|v| match v {
            crate::model::encryption::EncryptionMode::MpegCenc(v) => std::option::Option::Some(v),
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [encryption_mode][crate::model::Encryption::encryption_mode]
    /// to hold a `MpegCenc`.
    ///
    /// Note that all the setters affecting `encryption_mode` are
    /// mutually exclusive.
    pub fn set_mpeg_cenc<
        T: std::convert::Into<std::boxed::Box<crate::model::encryption::MpegCommonEncryption>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.encryption_mode =
            std::option::Option::Some(crate::model::encryption::EncryptionMode::MpegCenc(v.into()));
        self
    }

    /// Sets the value of [secret_source][crate::model::Encryption::secret_source].
    ///
    /// Note that all the setters affecting `secret_source` are mutually
    /// exclusive.
    pub fn set_secret_source<
        T: std::convert::Into<std::option::Option<crate::model::encryption::SecretSource>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.secret_source = v.into();
        self
    }

    /// The value of [secret_source][crate::model::Encryption::secret_source]
    /// if it holds a `SecretManagerKeySource`, `None` if the field is not set or
    /// holds a different branch.
    pub fn secret_manager_key_source(
        &self,
    ) -> std::option::Option<&std::boxed::Box<crate::model::encryption::SecretManagerSource>> {
        #[allow(unreachable_patterns)]
        self.secret_source.as_ref().and_then(|v| match v {
            crate::model::encryption::SecretSource::SecretManagerKeySource(v) => {
                std::option::Option::Some(v)
            }
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [secret_source][crate::model::Encryption::secret_source]
    /// to hold a `SecretManagerKeySource`.
    ///
    /// Note that all the setters affecting `secret_source` are
    /// mutually exclusive.
    pub fn set_secret_manager_key_source<
        T: std::convert::Into<std::boxed::Box<crate::model::encryption::SecretManagerSource>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.secret_source = std::option::Option::Some(
            crate::model::encryption::SecretSource::SecretManagerKeySource(v.into()),
        );
        self
    }
}

impl wkt::message::Message for Encryption {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.transcoder.v1.Encryption"
    }
}

/// Defines additional types related to [Encryption].
pub mod encryption {
    #[allow(unused_imports)]
    use super::*;

    /// Configuration for AES-128 encryption.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct Aes128Encryption {
        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl Aes128Encryption {
        pub fn new() -> Self {
            std::default::Default::default()
        }
    }

    impl wkt::message::Message for Aes128Encryption {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.video.transcoder.v1.Encryption.Aes128Encryption"
        }
    }

    /// Configuration for SAMPLE-AES encryption.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct SampleAesEncryption {
        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl SampleAesEncryption {
        pub fn new() -> Self {
            std::default::Default::default()
        }
    }

    impl wkt::message::Message for SampleAesEncryption {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.video.transcoder.v1.Encryption.SampleAesEncryption"
        }
    }

    /// Configuration for MPEG Common Encryption (MPEG-CENC).
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct MpegCommonEncryption {
        /// Required. Specify the encryption scheme.
        ///
        /// Supported encryption schemes:
        ///
        /// - `cenc`
        /// - `cbcs`
        pub scheme: std::string::String,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl MpegCommonEncryption {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [scheme][crate::model::encryption::MpegCommonEncryption::scheme].
        pub fn set_scheme<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.scheme = v.into();
            self
        }
    }

    impl wkt::message::Message for MpegCommonEncryption {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.video.transcoder.v1.Encryption.MpegCommonEncryption"
        }
    }

    /// Configuration for secrets stored in Google Secret Manager.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct SecretManagerSource {
        /// Required. The name of the Secret Version containing the encryption key in
        /// the following format:
        /// `projects/{project}/secrets/{secret_id}/versions/{version_number}`
        ///
        /// Note that only numbered versions are supported. Aliases like "latest" are
        /// not supported.
        pub secret_version: std::string::String,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl SecretManagerSource {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [secret_version][crate::model::encryption::SecretManagerSource::secret_version].
        pub fn set_secret_version<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.secret_version = v.into();
            self
        }
    }

    impl wkt::message::Message for SecretManagerSource {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.video.transcoder.v1.Encryption.SecretManagerSource"
        }
    }

    /// Widevine configuration.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct Widevine {
        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl Widevine {
        pub fn new() -> Self {
            std::default::Default::default()
        }
    }

    impl wkt::message::Message for Widevine {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.video.transcoder.v1.Encryption.Widevine"
        }
    }

    /// Fairplay configuration.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct Fairplay {
        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl Fairplay {
        pub fn new() -> Self {
            std::default::Default::default()
        }
    }

    impl wkt::message::Message for Fairplay {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.video.transcoder.v1.Encryption.Fairplay"
        }
    }

    /// Playready configuration.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct Playready {
        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl Playready {
        pub fn new() -> Self {
            std::default::Default::default()
        }
    }

    impl wkt::message::Message for Playready {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.video.transcoder.v1.Encryption.Playready"
        }
    }

    /// Clearkey configuration.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct Clearkey {
        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl Clearkey {
        pub fn new() -> Self {
            std::default::Default::default()
        }
    }

    impl wkt::message::Message for Clearkey {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.video.transcoder.v1.Encryption.Clearkey"
        }
    }

    /// Defines configuration for DRM systems in use.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct DrmSystems {
        /// Widevine configuration.
        pub widevine: std::option::Option<crate::model::encryption::Widevine>,

        /// Fairplay configuration.
        pub fairplay: std::option::Option<crate::model::encryption::Fairplay>,

        /// Playready configuration.
        pub playready: std::option::Option<crate::model::encryption::Playready>,

        /// Clearkey configuration.
        pub clearkey: std::option::Option<crate::model::encryption::Clearkey>,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl DrmSystems {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [widevine][crate::model::encryption::DrmSystems::widevine].
        pub fn set_widevine<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::encryption::Widevine>,
        {
            self.widevine = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [widevine][crate::model::encryption::DrmSystems::widevine].
        pub fn set_or_clear_widevine<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::encryption::Widevine>,
        {
            self.widevine = v.map(|x| x.into());
            self
        }

        /// Sets the value of [fairplay][crate::model::encryption::DrmSystems::fairplay].
        pub fn set_fairplay<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::encryption::Fairplay>,
        {
            self.fairplay = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [fairplay][crate::model::encryption::DrmSystems::fairplay].
        pub fn set_or_clear_fairplay<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::encryption::Fairplay>,
        {
            self.fairplay = v.map(|x| x.into());
            self
        }

        /// Sets the value of [playready][crate::model::encryption::DrmSystems::playready].
        pub fn set_playready<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::encryption::Playready>,
        {
            self.playready = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [playready][crate::model::encryption::DrmSystems::playready].
        pub fn set_or_clear_playready<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::encryption::Playready>,
        {
            self.playready = v.map(|x| x.into());
            self
        }

        /// Sets the value of [clearkey][crate::model::encryption::DrmSystems::clearkey].
        pub fn set_clearkey<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::encryption::Clearkey>,
        {
            self.clearkey = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [clearkey][crate::model::encryption::DrmSystems::clearkey].
        pub fn set_or_clear_clearkey<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::encryption::Clearkey>,
        {
            self.clearkey = v.map(|x| x.into());
            self
        }
    }

    impl wkt::message::Message for DrmSystems {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.video.transcoder.v1.Encryption.DrmSystems"
        }
    }

    /// Encryption mode can be either `aes` or `cenc`.
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum EncryptionMode {
        /// Configuration for AES-128 encryption.
        Aes128(std::boxed::Box<crate::model::encryption::Aes128Encryption>),
        /// Configuration for SAMPLE-AES encryption.
        SampleAes(std::boxed::Box<crate::model::encryption::SampleAesEncryption>),
        /// Configuration for MPEG Common Encryption (MPEG-CENC).
        MpegCenc(std::boxed::Box<crate::model::encryption::MpegCommonEncryption>),
    }

    /// Defines where content keys are stored.
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum SecretSource {
        /// Keys are stored in Google Secret Manager.
        SecretManagerKeySource(std::boxed::Box<crate::model::encryption::SecretManagerSource>),
    }
}

/// Request message for `TranscoderService.CreateJob`.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateJobRequest {
    /// Required. The parent location to create and process this job.
    /// Format: `projects/{project}/locations/{location}`
    pub parent: std::string::String,

    /// Required. Parameters for creating transcoding job.
    pub job: std::option::Option<crate::model::Job>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreateJobRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreateJobRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [job][crate::model::CreateJobRequest::job].
    pub fn set_job<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Job>,
    {
        self.job = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [job][crate::model::CreateJobRequest::job].
    pub fn set_or_clear_job<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Job>,
    {
        self.job = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for CreateJobRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.transcoder.v1.CreateJobRequest"
    }
}

/// Request message for `TranscoderService.ListJobs`.
/// The parent location from which to retrieve the collection of jobs.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListJobsRequest {
    /// Required. Format: `projects/{project}/locations/{location}`
    pub parent: std::string::String,

    /// The maximum number of items to return.
    pub page_size: i32,

    /// The `next_page_token` value returned from a previous List request, if
    /// any.
    pub page_token: std::string::String,

    /// The filter expression, following the syntax outlined in
    /// <https://google.aip.dev/160>.
    pub filter: std::string::String,

    /// One or more fields to compare and use to sort the output.
    /// See <https://google.aip.dev/132#ordering>.
    pub order_by: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListJobsRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListJobsRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListJobsRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListJobsRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::ListJobsRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }

    /// Sets the value of [order_by][crate::model::ListJobsRequest::order_by].
    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.order_by = v.into();
        self
    }
}

impl wkt::message::Message for ListJobsRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.transcoder.v1.ListJobsRequest"
    }
}

/// Request message for `TranscoderService.GetJob`.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetJobRequest {
    /// Required. The name of the job to retrieve.
    /// Format: `projects/{project}/locations/{location}/jobs/{job}`
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetJobRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetJobRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetJobRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.transcoder.v1.GetJobRequest"
    }
}

/// Request message for `TranscoderService.DeleteJob`.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteJobRequest {
    /// Required. The name of the job to delete.
    /// Format: `projects/{project}/locations/{location}/jobs/{job}`
    pub name: std::string::String,

    /// If set to true, and the job is not found, the request will succeed but no
    /// action will be taken on the server.
    pub allow_missing: bool,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DeleteJobRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DeleteJobRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [allow_missing][crate::model::DeleteJobRequest::allow_missing].
    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.allow_missing = v.into();
        self
    }
}

impl wkt::message::Message for DeleteJobRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.transcoder.v1.DeleteJobRequest"
    }
}

/// Response message for `TranscoderService.ListJobs`.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListJobsResponse {
    /// List of jobs in the specified region.
    pub jobs: std::vec::Vec<crate::model::Job>,

    /// The pagination token.
    pub next_page_token: std::string::String,

    /// List of regions that could not be reached.
    pub unreachable: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListJobsResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [jobs][crate::model::ListJobsResponse::jobs].
    pub fn set_jobs<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::Job>,
    {
        use std::iter::Iterator;
        self.jobs = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListJobsResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }

    /// Sets the value of [unreachable][crate::model::ListJobsResponse::unreachable].
    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.unreachable = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for ListJobsResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.transcoder.v1.ListJobsResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListJobsResponse {
    type PageItem = crate::model::Job;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.jobs
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// Request message for `TranscoderService.CreateJobTemplate`.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateJobTemplateRequest {
    /// Required. The parent location to create this job template.
    /// Format: `projects/{project}/locations/{location}`
    pub parent: std::string::String,

    /// Required. Parameters for creating job template.
    pub job_template: std::option::Option<crate::model::JobTemplate>,

    /// Required. The ID to use for the job template, which will become the final
    /// component of the job template's resource name.
    ///
    /// This value should be 4-63 characters, and valid characters must match the
    /// regular expression `[a-zA-Z][a-zA-Z0-9_-]*`.
    pub job_template_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreateJobTemplateRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreateJobTemplateRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [job_template][crate::model::CreateJobTemplateRequest::job_template].
    pub fn set_job_template<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::JobTemplate>,
    {
        self.job_template = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [job_template][crate::model::CreateJobTemplateRequest::job_template].
    pub fn set_or_clear_job_template<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::JobTemplate>,
    {
        self.job_template = v.map(|x| x.into());
        self
    }

    /// Sets the value of [job_template_id][crate::model::CreateJobTemplateRequest::job_template_id].
    pub fn set_job_template_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.job_template_id = v.into();
        self
    }
}

impl wkt::message::Message for CreateJobTemplateRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.transcoder.v1.CreateJobTemplateRequest"
    }
}

/// Request message for `TranscoderService.ListJobTemplates`.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListJobTemplatesRequest {
    /// Required. The parent location from which to retrieve the collection of job
    /// templates. Format: `projects/{project}/locations/{location}`
    pub parent: std::string::String,

    /// The maximum number of items to return.
    pub page_size: i32,

    /// The `next_page_token` value returned from a previous List request, if
    /// any.
    pub page_token: std::string::String,

    /// The filter expression, following the syntax outlined in
    /// <https://google.aip.dev/160>.
    pub filter: std::string::String,

    /// One or more fields to compare and use to sort the output.
    /// See <https://google.aip.dev/132#ordering>.
    pub order_by: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListJobTemplatesRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListJobTemplatesRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListJobTemplatesRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListJobTemplatesRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::ListJobTemplatesRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }

    /// Sets the value of [order_by][crate::model::ListJobTemplatesRequest::order_by].
    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.order_by = v.into();
        self
    }
}

impl wkt::message::Message for ListJobTemplatesRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.transcoder.v1.ListJobTemplatesRequest"
    }
}

/// Request message for `TranscoderService.GetJobTemplate`.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetJobTemplateRequest {
    /// Required. The name of the job template to retrieve.
    /// Format:
    /// `projects/{project}/locations/{location}/jobTemplates/{job_template}`
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetJobTemplateRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetJobTemplateRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetJobTemplateRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.transcoder.v1.GetJobTemplateRequest"
    }
}

/// Request message for `TranscoderService.DeleteJobTemplate`.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteJobTemplateRequest {
    /// Required. The name of the job template to delete.
    /// `projects/{project}/locations/{location}/jobTemplates/{job_template}`
    pub name: std::string::String,

    /// If set to true, and the job template is not found, the request will succeed
    /// but no action will be taken on the server.
    pub allow_missing: bool,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DeleteJobTemplateRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DeleteJobTemplateRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [allow_missing][crate::model::DeleteJobTemplateRequest::allow_missing].
    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.allow_missing = v.into();
        self
    }
}

impl wkt::message::Message for DeleteJobTemplateRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.transcoder.v1.DeleteJobTemplateRequest"
    }
}

/// Response message for `TranscoderService.ListJobTemplates`.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListJobTemplatesResponse {
    /// List of job templates in the specified region.
    pub job_templates: std::vec::Vec<crate::model::JobTemplate>,

    /// The pagination token.
    pub next_page_token: std::string::String,

    /// List of regions that could not be reached.
    pub unreachable: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListJobTemplatesResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [job_templates][crate::model::ListJobTemplatesResponse::job_templates].
    pub fn set_job_templates<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::JobTemplate>,
    {
        use std::iter::Iterator;
        self.job_templates = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListJobTemplatesResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }

    /// Sets the value of [unreachable][crate::model::ListJobTemplatesResponse::unreachable].
    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.unreachable = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for ListJobTemplatesResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.video.transcoder.v1.ListJobTemplatesResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListJobTemplatesResponse {
    type PageItem = crate::model::JobTemplate;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.job_templates
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}
